Documentation
¶
Index ¶
Constants ¶
View Source
const ( PackLenSize = 4 MaxBodySize = int32(1 << 14) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeaderCarrier ¶
func (HeaderCarrier) Add ¶
func (mc HeaderCarrier) Add(key string, value string)
func (HeaderCarrier) Get ¶
func (mc HeaderCarrier) Get(key string) string
func (HeaderCarrier) Keys ¶
func (mc HeaderCarrier) Keys() []string
func (HeaderCarrier) Set ¶
func (mc HeaderCarrier) Set(key string, value string)
func (HeaderCarrier) Values ¶
func (mc HeaderCarrier) Values(key string) []string
type Service ¶
type Service interface {
Auth(ctx context.Context, in []byte) (out []byte, ss Session, err error)
TunnelType(mod int32) (int32, error)
CreateTunnel(ctx context.Context, ss Session, tp int32, routerId int64, worker tunnel.Worker) (tunnel.Tunnel, error)
OnConnected(ctx context.Context, ss Session) (err error)
OnDisconnect(ctx context.Context, ss Session) (err error)
Handle(ctx context.Context, ss Session, h tunnel.Holder, in []byte) (err error)
}
type Session ¶
type Session interface {
Encryptor
UID() int64
SID() int64
Color() string
Status() int64
StartTime() int64
ClientIP() string
SetClientIP(ip string)
CSIndex() int64
SCIndex() int64
IncreaseCSIndex() int64
IncreaseSCIndex() int64
}
func DefaultSession ¶
func DefaultSession() Session
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(endpoint string, operation string, requestHeader HeaderCarrier, replyHeader HeaderCarrier, ) *Transport
func (*Transport) ReplyHeader ¶
func (*Transport) RequestHeader ¶
Click to show internal directories.
Click to hide internal directories.