protocol

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 9687
)
View Source
const (
	HeaderMagic = 183
)

Variables

View Source
var (
	ErrIllegalMethod = errors.System.Newf("Illegal protocol method")
)
View Source
var (
	ErrNoSuchProcess = errors.System.Newf("no such process")
)

Functions

This section is empty.

Types

type Header struct {
	Method       Method
	ConnectionId connection.Id
}

func (*Header) DecodeMsgPack

func (this *Header) DecodeMsgPack(dec codec.MsgPackDecoder) (err error)

func (*Header) DecodeMsgpack

func (this *Header) DecodeMsgpack(dec *msgpack.Decoder) error

func (Header) EncodeMsgPack

func (this Header) EncodeMsgPack(enc codec.MsgPackEncoder) error

func (Header) EncodeMsgpack

func (this Header) EncodeMsgpack(enc *msgpack.Encoder) error

type Imp

type Imp struct {
	MasterPublicKey crypto.PublicKey
	SessionId       session.Id
	Addr            string
	Logger          log.Logger
}

func (*Imp) Serve

func (this *Imp) Serve(ctx context.Context) error

type Master

type Master struct {
	PrivateKey crypto.PrivateKey
	// contains filtered or unexported fields
}

func NewMaster

func NewMaster(_ context.Context, masterPrivateKey crypto.PrivateKey) (*Master, error)

func (*Master) DialContext

func (this *Master) DialContext(ctx context.Context, ref Ref) (gonet.Conn, error)

func (*Master) DialContextWithMsgPack

func (this *Master) DialContextWithMsgPack(ctx context.Context, ref Ref) (codec.MsgPackConn, error)

func (*Master) Open

func (this *Master) Open(_ context.Context, ref Ref) (*MasterSession, error)

type MasterSession

type MasterSession struct {
	// contains filtered or unexported fields
}

func (*MasterSession) Close

func (this *MasterSession) Close() error

func (*MasterSession) InitiateNamedPipe

func (this *MasterSession) InitiateNamedPipe(ctx context.Context, connectionId connection.Id, purpose net.Purpose) (net.NamedPipe, error)

func (*MasterSession) InitiateTcpForward

func (this *MasterSession) InitiateTcpForward(ctx context.Context, connectionId connection.Id, target net.HostPort) (gonet.Conn, error)

func (*MasterSession) Kill

func (this *MasterSession) Kill(ctx context.Context, connectionId connection.Id, pid int, signal sys.Signal) error

func (*MasterSession) Ping

func (this *MasterSession) Ping(ctx context.Context, connectionId connection.Id) error

type Method

type Method uint8
const (
	MethodPing Method = iota
	MethodKill
	MethodTcpForward
	MethodNamedPipe
)

func (*Method) DecodeMsgPack

func (this *Method) DecodeMsgPack(dec codec.MsgPackDecoder) error

func (*Method) DecodeMsgpack

func (this *Method) DecodeMsgpack(dec *msgpack.Decoder) error

func (Method) EncodeMsgPack

func (this Method) EncodeMsgPack(enc codec.MsgPackEncoder) error

func (Method) EncodeMsgpack

func (this Method) EncodeMsgpack(enc *msgpack.Encoder) error

func (Method) MarshalText

func (this Method) MarshalText() ([]byte, error)

func (Method) String

func (this Method) String() string

func (Method) Validate

func (this Method) Validate() error

type Ref

type Ref interface {
	SessionId() session.Id
	PublicKey() crypto.PublicKey
	EndpointAddr() net.HostPort
}

Jump to

Keyboard shortcuts

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