proto

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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_proto_proto protoreflect.FileDescriptor

Functions

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 Error

type Error struct {
	Code    Error_Code `protobuf:"varint,1,opt,name=code,proto3,enum=proto.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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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