Documentation ¶
Index ¶
- func CopyWithContext(ctx context.Context, src io.Reader, dst io.Writer) error
- func DoQUICRequest[T, R proto.Message](ctx context.Context, msg T, ret R, conn quic.Connection, ...) error
- func Forward(ctx context.Context, x, y io.ReadWriter) error
- func GenerateAuthToken(ak, sk string) *packet.Handshake
- func GenerateSignature(args ...string) []byte
- func GenerateSignatureString(args ...string) string
- func RetWithError(e error) *packet.Ret
- func RunWorkers[T Worker](ctx context.Context, workers ...T) error
- type App
- type Config
- type ErrorNo
- type Node
- type RequestCallback
- type Service
- type ServiceMapping
- type Session
- type SessionExecCallback
- type SessionManager
- type Validator
- type Worker
- type WorkerCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyWithContext ¶
func DoQUICRequest ¶
func GenerateAuthToken ¶
func GenerateSignature ¶
func GenerateSignatureString ¶
func RetWithError ¶
Types ¶
type Config ¶
type Config struct { HeartbeatInterval time.Duration `json:"heartbeat_interval"` // 心跳时间间隔 MaxHeartbeatInterval time.Duration `json:"max_heartbeat_interval"` // 最大心跳时间间隔 LocalAddress string `json:"local_address"` ConnectionQueueSize int `json:"connection_queue_size"` // 连接队列的大小 HandshakeTimeout time.Duration `json:"handshake_timeout"` }
func DefaultConfig ¶
func DefaultConfig() *Config
type RequestCallback ¶
type Service ¶
type Service interface { Type() packet.CommandType Invoke(ctx context.Context, command *packet.Command, session Session, manager SessionManager, stream quic.Stream) error }
type ServiceMapping ¶
type ServiceMapping map[packet.CommandType]Service
func (ServiceMapping) Invoke ¶
func (mapping ServiceMapping) Invoke(ctx context.Context, cmd *packet.Command, session Session, manager SessionManager, stream quic.Stream) error
func (ServiceMapping) Register ¶
func (mapping ServiceMapping) Register(services ...Service) ServiceMapping
func (ServiceMapping) Type ¶
func (mapping ServiceMapping) Type() packet.CommandType
type SessionExecCallback ¶
type SessionManager ¶
type Validator ¶
func NewBasicValidator ¶
Click to show internal directories.
Click to hide internal directories.