packet

package
v0.0.0-...-39cf8b4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCode_name = map[int32]string{
		0: "NoError",
		1: "AuthError",
		2: "UnknownApp",
		3: "SignatureTimeout",
		4: "HandshakeFailed",
		5: "UnknownCommand",
		6: "UnknownSession",
	}
	ErrCode_value = map[string]int32{
		"NoError":          0,
		"AuthError":        1,
		"UnknownApp":       2,
		"SignatureTimeout": 3,
		"HandshakeFailed":  4,
		"UnknownCommand":   5,
		"UnknownSession":   6,
	}
)

Enum value maps for ErrCode.

View Source
var (
	CommandType_name = map[int32]string{
		0: "EMPTY",
		1: "ECHO",
		2: "EXEC",
		3: "PROXY",
		4: "FORWARD",
	}
	CommandType_value = map[string]int32{
		"EMPTY":   0,
		"ECHO":    1,
		"EXEC":    2,
		"PROXY":   3,
		"FORWARD": 4,
	}
)

Enum value maps for CommandType.

View Source
var File_packet_proto protoreflect.FileDescriptor

Functions

func NewProtoReader

func NewProtoReader(stream quic.ReceiveStream) protodelim.Reader

Types

type Command

type Command struct {
	Type   CommandType     `protobuf:"varint,1,opt,name=type,proto3,enum=packet.CommandType" json:"type,omitempty"`
	Args   []string        `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	Params []*CommandParam `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty"`
	// contains filtered or unexported fields
}

func ForwardCommand

func ForwardCommand(remote, addr string) *Command

ForwardCommand FORWARD <REMOTE> <ADDRESS> like FORWARD xxx 127.0.0.1:8000

func (*Command) Descriptor deprecated

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

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetArgs

func (x *Command) GetArgs() []string

func (*Command) GetParam

func (x *Command) GetParam(key string) (string, bool)

func (*Command) GetParamWithDefault

func (x *Command) GetParamWithDefault(key, val string) string

func (*Command) GetParams

func (x *Command) GetParams() []*CommandParam

func (*Command) GetType

func (x *Command) GetType() CommandType

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

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

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type CommandParam

type CommandParam struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandParam) Descriptor deprecated

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

Deprecated: Use CommandParam.ProtoReflect.Descriptor instead.

func (*CommandParam) GetKey

func (x *CommandParam) GetKey() string

func (*CommandParam) GetValue

func (x *CommandParam) GetValue() string

func (*CommandParam) ProtoMessage

func (*CommandParam) ProtoMessage()

func (*CommandParam) ProtoReflect

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

func (*CommandParam) Reset

func (x *CommandParam) Reset()

func (*CommandParam) String

func (x *CommandParam) String() string

type CommandType

type CommandType int32
const (
	CommandType_EMPTY   CommandType = 0
	CommandType_ECHO    CommandType = 1
	CommandType_EXEC    CommandType = 2
	CommandType_PROXY   CommandType = 3
	CommandType_FORWARD CommandType = 4
)

func (CommandType) Descriptor

func (CommandType) Enum

func (x CommandType) Enum() *CommandType

func (CommandType) EnumDescriptor deprecated

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

Deprecated: Use CommandType.Descriptor instead.

func (CommandType) Number

func (x CommandType) Number() protoreflect.EnumNumber

func (CommandType) String

func (x CommandType) String() string

func (CommandType) Type

type ErrCode

type ErrCode int32
const (
	ErrCode_NoError          ErrCode = 0
	ErrCode_AuthError        ErrCode = 1
	ErrCode_UnknownApp       ErrCode = 2
	ErrCode_SignatureTimeout ErrCode = 3
	ErrCode_HandshakeFailed  ErrCode = 4
	ErrCode_UnknownCommand   ErrCode = 5
	ErrCode_UnknownSession   ErrCode = 6
)

func (ErrCode) Descriptor

func (ErrCode) Descriptor() protoreflect.EnumDescriptor

func (ErrCode) Enum

func (x ErrCode) Enum() *ErrCode

func (ErrCode) EnumDescriptor deprecated

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

Deprecated: Use ErrCode.Descriptor instead.

func (ErrCode) Number

func (x ErrCode) Number() protoreflect.EnumNumber

func (ErrCode) String

func (x ErrCode) String() string

func (ErrCode) Type

func (ErrCode) Type() protoreflect.EnumType

type Handshake

type Handshake struct {
	AccessKey string `protobuf:"bytes,1,opt,name=accessKey,proto3" json:"accessKey,omitempty"`
	Sign      string `protobuf:"bytes,2,opt,name=sign,proto3" json:"sign,omitempty"`
	T         uint64 `protobuf:"varint,3,opt,name=t,proto3" json:"t,omitempty"`
	// contains filtered or unexported fields
}

func (*Handshake) Descriptor deprecated

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

Deprecated: Use Handshake.ProtoReflect.Descriptor instead.

func (*Handshake) GetAccessKey

func (x *Handshake) GetAccessKey() string

func (*Handshake) GetSign

func (x *Handshake) GetSign() string

func (*Handshake) GetT

func (x *Handshake) GetT() uint64

func (*Handshake) ProtoMessage

func (*Handshake) ProtoMessage()

func (*Handshake) ProtoReflect

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

func (*Handshake) Reset

func (x *Handshake) Reset()

func (*Handshake) String

func (x *Handshake) String() string

type Heartbeat

type Heartbeat struct {
	Hostname  string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Username  string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	OsName    string `protobuf:"bytes,3,opt,name=osName,proto3" json:"osName,omitempty"`
	Localtime int64  `protobuf:"varint,4,opt,name=localtime,proto3" json:"localtime,omitempty"`
	// contains filtered or unexported fields
}

func NewHeartbeat

func NewHeartbeat() (*Heartbeat, error)

func (*Heartbeat) Descriptor deprecated

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

Deprecated: Use Heartbeat.ProtoReflect.Descriptor instead.

func (*Heartbeat) GetHostname

func (x *Heartbeat) GetHostname() string

func (*Heartbeat) GetLocaltime

func (x *Heartbeat) GetLocaltime() int64

func (*Heartbeat) GetOsName

func (x *Heartbeat) GetOsName() string

func (*Heartbeat) GetUsername

func (x *Heartbeat) GetUsername() string

func (*Heartbeat) ProtoMessage

func (*Heartbeat) ProtoMessage()

func (*Heartbeat) ProtoReflect

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

func (*Heartbeat) Reset

func (x *Heartbeat) Reset()

func (*Heartbeat) String

func (x *Heartbeat) String() string

type Ret

type Ret struct {
	ErrNo uint64 `protobuf:"varint,1,opt,name=errNo,proto3" json:"errNo,omitempty"`
	Msg   string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*Ret) Descriptor deprecated

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

Deprecated: Use Ret.ProtoReflect.Descriptor instead.

func (*Ret) GetErrNo

func (x *Ret) GetErrNo() uint64

func (*Ret) GetMsg

func (x *Ret) GetMsg() string

func (*Ret) ProtoMessage

func (*Ret) ProtoMessage()

func (*Ret) ProtoReflect

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

func (*Ret) Reset

func (x *Ret) Reset()

func (*Ret) String

func (x *Ret) String() string

Jump to

Keyboard shortcuts

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