framing

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Data                         = 0
	ClientSessionRequest         = 1
	ClientSessionRequestWithAuth = 0b10000001
	ServerSessionAck             = 2
	Close                        = 3
	ErrorClientID                = 4
	ErrorSessionID               = 5
	Authentication               = 6
	AuthenticationAck            = 7
)
View Source
const AuthenticationEndpoint = 0xFFFF

AuthenticationEndpoint is a phantom endpoint that's used to signify an authentication message

Variables

This section is empty.

Functions

func CreateErrorClient

func CreateErrorClient(endpointId uint16, clientId uint32, message string) []byte

func CreateErrorSession

func CreateErrorSession(endpointId uint16, sessionId uint32, message string) []byte

Types

type AuthenticationAckFrame

type AuthenticationAckFrame struct {
	TokenHash [32]byte
}

func NewAuthenticationAck

func NewAuthenticationAck(token string) AuthenticationAckFrame

func (*AuthenticationAckFrame) Encode

func (frame *AuthenticationAckFrame) Encode() *[]byte

type MessageFrame

type MessageFrame struct {
	EndpointId uint16
	Flag       uint8
	SessionId  uint32
	Data       []byte
}

func (*MessageFrame) Close

func (frame *MessageFrame) Close() []byte

func (MessageFrame) Encode

func (frame MessageFrame) Encode() []byte

type SessionFrame

type SessionFrame struct {
	EndpointId uint16
	Flag       uint8
	ClientId   uint32
	Token      string
	SessionId  *uint32
}

func (*SessionFrame) Ack

func (frame *SessionFrame) Ack(sessionId uint32) *[]byte

func (*SessionFrame) Encode

func (frame *SessionFrame) Encode() []byte

Jump to

Keyboard shortcuts

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