pb

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Role_name = map[int32]string{
		0: "RoleUnknown",
		1: "RoleDestination",
		2: "RoleSource",
	}
	Role_value = map[string]int32{
		"RoleUnknown":     0,
		"RoleDestination": 1,
		"RoleSource":      2,
	}
)

Enum value maps for Role.

View Source
var (
	Error_Code_name = map[int32]string{
		0:   "Unknown",
		1:   "RequestUnknown",
		2:   "ConnectionCheckFailed",
		100: "AuthenticationFailed",
		101: "ForwardNotAllowed",
		102: "RoleNotAllowed",
		200: "AnnounceValidationFailed",
		201: "AnnounceInvalidClientCertificate",
		202: "AnnounceInvalidServerCertificate",
		300: "RelayValidationFailed",
		301: "RelayInvalidCertificate",
		302: "RelayKeepaliveClosed",
		400: "DirectConnectionClosed",
		401: "DirectKeepaliveClosed",
		500: "DestinationNotFound",
		501: "DestinationDialFailed",
		502: "DestinationRelayEncryptionError",
	}
	Error_Code_value = map[string]int32{
		"Unknown":                          0,
		"RequestUnknown":                   1,
		"ConnectionCheckFailed":            2,
		"AuthenticationFailed":             100,
		"ForwardNotAllowed":                101,
		"RoleNotAllowed":                   102,
		"AnnounceValidationFailed":         200,
		"AnnounceInvalidClientCertificate": 201,
		"AnnounceInvalidServerCertificate": 202,
		"RelayValidationFailed":            300,
		"RelayInvalidCertificate":          301,
		"RelayKeepaliveClosed":             302,
		"DirectConnectionClosed":           400,
		"DirectKeepaliveClosed":            401,
		"DestinationNotFound":              500,
		"DestinationDialFailed":            501,
		"DestinationRelayEncryptionError":  502,
	}
)

Enum value maps for Error_Code.

View Source
var File_shared_proto protoreflect.FileDescriptor

Functions

func AsNetips

func AsNetips(pb []*AddrPort) []netip.AddrPort

func GetAppError

func GetAppError(err error) *quic.ApplicationError

func Read

func Read(r io.Reader, msg proto.Message) error

func Write

func Write(w io.Writer, msg proto.Message) error

Types

type Addr

type Addr struct {
	V4 []byte `protobuf:"bytes,1,opt,name=v4,proto3" json:"v4,omitempty"`
	V6 []byte `protobuf:"bytes,2,opt,name=v6,proto3" json:"v6,omitempty"`
	// contains filtered or unexported fields
}

func AddrFromNetip added in v0.4.0

func AddrFromNetip(addr netip.Addr) *Addr

func (*Addr) AsNetip added in v0.4.0

func (a *Addr) AsNetip() netip.Addr

func (*Addr) Descriptor deprecated

func (*Addr) Descriptor() ([]byte, []int)

Deprecated: Use Addr.ProtoReflect.Descriptor instead.

func (*Addr) GetV4

func (x *Addr) GetV4() []byte

func (*Addr) GetV6

func (x *Addr) GetV6() []byte

func (*Addr) ProtoMessage

func (*Addr) ProtoMessage()

func (*Addr) ProtoReflect

func (x *Addr) ProtoReflect() protoreflect.Message

func (*Addr) Reset

func (x *Addr) Reset()

func (*Addr) String

func (x *Addr) String() string

type AddrPort

type AddrPort struct {
	Addr *Addr  `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
	Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // really uint16, but not a thing in protobuf
	// contains filtered or unexported fields
}

func AddrPortFromNet

func AddrPortFromNet(addr net.Addr) (*AddrPort, error)

func AddrPortFromNetip

func AddrPortFromNetip(addr netip.AddrPort) *AddrPort

func AsAddrPorts

func AsAddrPorts(addrs []netip.AddrPort) []*AddrPort

func (*AddrPort) AsNetip

func (a *AddrPort) AsNetip() netip.AddrPort

func (*AddrPort) Descriptor deprecated

func (*AddrPort) Descriptor() ([]byte, []int)

Deprecated: Use AddrPort.ProtoReflect.Descriptor instead.

func (*AddrPort) GetAddr

func (x *AddrPort) GetAddr() *Addr

func (*AddrPort) GetPort

func (x *AddrPort) GetPort() uint32

func (*AddrPort) ProtoMessage

func (*AddrPort) ProtoMessage()

func (*AddrPort) ProtoReflect

func (x *AddrPort) ProtoReflect() protoreflect.Message

func (*AddrPort) Reset

func (x *AddrPort) Reset()

func (*AddrPort) String

func (x *AddrPort) String() string

type Error

type Error struct {
	Code    Error_Code `protobuf:"varint,1,opt,name=code,proto3,enum=shared.Error_Code" json:"code,omitempty"`
	Message string     `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func GetError

func GetError(err error) *Error

func NewError

func NewError(code Error_Code, msg string, args ...any) *Error

func (*Error) Descriptor deprecated

func (*Error) Descriptor() ([]byte, []int)

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) Error

func (e *Error) Error() string

func (*Error) GetCode

func (x *Error) GetCode() Error_Code

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

func (x *Error) ProtoReflect() protoreflect.Message

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type Error_Code

type Error_Code int32
const (
	// Generic
	Error_Unknown               Error_Code = 0
	Error_RequestUnknown        Error_Code = 1
	Error_ConnectionCheckFailed Error_Code = 2
	// Authentication
	Error_AuthenticationFailed Error_Code = 100
	Error_ForwardNotAllowed    Error_Code = 101
	Error_RoleNotAllowed       Error_Code = 102
	// Announce
	Error_AnnounceValidationFailed         Error_Code = 200
	Error_AnnounceInvalidClientCertificate Error_Code = 201
	Error_AnnounceInvalidServerCertificate Error_Code = 202
	// Relay
	Error_RelayValidationFailed   Error_Code = 300
	Error_RelayInvalidCertificate Error_Code = 301
	Error_RelayKeepaliveClosed    Error_Code = 302
	// Direct
	Error_DirectConnectionClosed Error_Code = 400
	Error_DirectKeepaliveClosed  Error_Code = 401
	// Client connect codes
	Error_DestinationNotFound             Error_Code = 500
	Error_DestinationDialFailed           Error_Code = 501
	Error_DestinationRelayEncryptionError Error_Code = 502
)

func (Error_Code) Descriptor

func (Error_Code) Descriptor() protoreflect.EnumDescriptor

func (Error_Code) Enum

func (x Error_Code) Enum() *Error_Code

func (Error_Code) EnumDescriptor deprecated

func (Error_Code) EnumDescriptor() ([]byte, []int)

Deprecated: Use Error_Code.Descriptor instead.

func (Error_Code) Number

func (x Error_Code) Number() protoreflect.EnumNumber

func (Error_Code) String

func (x Error_Code) String() string

func (Error_Code) Type

type Forward

type Forward struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*Forward) Descriptor deprecated

func (*Forward) Descriptor() ([]byte, []int)

Deprecated: Use Forward.ProtoReflect.Descriptor instead.

func (*Forward) GetName

func (x *Forward) GetName() string

func (*Forward) ProtoMessage

func (*Forward) ProtoMessage()

func (*Forward) ProtoReflect

func (x *Forward) ProtoReflect() protoreflect.Message

func (*Forward) Reset

func (x *Forward) Reset()

func (*Forward) String

func (x *Forward) String() string

type HostPort

type HostPort struct {
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	// contains filtered or unexported fields
}

func (*HostPort) Descriptor deprecated

func (*HostPort) Descriptor() ([]byte, []int)

Deprecated: Use HostPort.ProtoReflect.Descriptor instead.

func (*HostPort) GetHost

func (x *HostPort) GetHost() string

func (*HostPort) GetPort

func (x *HostPort) GetPort() uint32

func (*HostPort) ProtoMessage

func (*HostPort) ProtoMessage()

func (*HostPort) ProtoReflect

func (x *HostPort) ProtoReflect() protoreflect.Message

func (*HostPort) Reset

func (x *HostPort) Reset()

func (*HostPort) String

func (x *HostPort) String() string

type Role

type Role int32
const (
	Role_RoleUnknown     Role = 0
	Role_RoleDestination Role = 1
	Role_RoleSource      Role = 2
)

func (Role) Descriptor

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum

func (x Role) Enum() *Role

func (Role) EnumDescriptor deprecated

func (Role) EnumDescriptor() ([]byte, []int)

Deprecated: Use Role.Descriptor instead.

func (Role) Number

func (x Role) Number() protoreflect.EnumNumber

func (Role) String

func (x Role) String() string

func (Role) Type

func (Role) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL