Documentation
¶
Index ¶
- func BytesToInt64(bytes []byte) int64
- func Int64ToBytes(num int64, byteCount int) []byte
- func ReadBuf(r io.Reader, size int, field string) ([]byte, rest.IErrorArgs)
- func ReadBufSize(r io.Reader, lenSize int, field string) ([]byte, rest.IErrorArgs)
- func ReadByte(r io.Reader, field string, result *byte) rest.IErrorArgs
- func ReadInt64(r io.Reader, size int, field string, result *int64) rest.IErrorArgs
- func ReadString(r io.Reader, lenSize int, field string, result *string) rest.IErrorArgs
- func WriteBuf(w io.Writer, buf []byte, field string) rest.IErrorArgs
- func WriteBufSize(w io.Writer, val []byte, lenSize int, field string) rest.IErrorArgs
- func WriteByte(w io.Writer, val byte, field string) rest.IErrorArgs
- func WriteInt64(w io.Writer, val int64, size int, field string) rest.IErrorArgs
- func WriteString(w io.Writer, val, field string, lenSize int) rest.IErrorArgs
- type Application
- type RequestIn
- func (s *RequestIn) Auth() json.Map
- func (s *RequestIn) ClientData(key string) (any, bool)
- func (s *RequestIn) GenerateToken(data json.Map, expire int64) (string, error)
- func (s *RequestIn) OutError(err rest.IErrorArgs) rest.IRequestOut
- func (s *RequestIn) OutSuccess(data json.Map, files rest.RequestFiles) rest.IRequestOut
- func (s *RequestIn) RCore() any
- func (s *RequestIn) ROwner() rest.IOwner
- func (s *RequestIn) SetAuth(auth json.Map)
- func (s *RequestIn) SetClientData(key string, data any)
- type Rest
- type Socket
- type SocketServer
- func (s *SocketServer) Auth() json.Map
- func (s *SocketServer) ClientData(key string) (any, bool)
- func (s *SocketServer) Close()
- func (s *SocketServer) Context() context.Context
- func (s *SocketServer) In() <-chan rest.IRequestIn
- func (s *SocketServer) IsStream() bool
- func (s *SocketServer) SendMessage(req rest.IRequestOut) (<-chan *rest.RequestStream, error)
- func (s *SocketServer) SetAuth(auth json.Map)
- func (s *SocketServer) SetClientData(key string, data any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToInt64 ¶
BytesToInt64 конвертирует срез байтов в int64
func Int64ToBytes ¶
Int64ToBytes упаковывает int64 в срез байтов заданной длины
func ReadBufSize ¶
func ReadString ¶
func WriteBufSize ¶
func WriteInt64 ¶
func WriteString ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(ctx context.Context) *Application
func (*Application) Connect ¶
func (s *Application) Connect() chan<- *SocketServer
func (*Application) Disconnect ¶
func (s *Application) Disconnect() chan<- *SocketServer
type RequestIn ¶
type RequestIn struct { *rest.RequestStream // contains filtered or unexported fields }
func (*RequestIn) GenerateToken ¶
func (*RequestIn) OutError ¶
func (s *RequestIn) OutError(err rest.IErrorArgs) rest.IRequestOut
func (*RequestIn) OutSuccess ¶
func (s *RequestIn) OutSuccess(data json.Map, files rest.RequestFiles) rest.IRequestOut
func (*RequestIn) SetClientData ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
func (*Socket) MessagesIn ¶
func (s *Socket) MessagesIn() <-chan *rest.RequestStream
MessagesIn возвращает канал, в который будут переданы все входящие сообщения (rest.RequestTypeMessage и rest.RequestTypeEvent)
func (*Socket) SendMessage ¶
func (s *Socket) SendMessage(req *rest.RequestStream) (ch <-chan *rest.RequestStream, err error)
type SocketServer ¶
type SocketServer struct {
// contains filtered or unexported fields
}
func NewSocketServer ¶
func NewSocketServer(socket *Socket, appConf *appConfig) *SocketServer
func (*SocketServer) Auth ¶
func (s *SocketServer) Auth() json.Map
func (*SocketServer) ClientData ¶
func (s *SocketServer) ClientData(key string) (any, bool)
func (*SocketServer) Close ¶
func (s *SocketServer) Close()
func (*SocketServer) Context ¶
func (s *SocketServer) Context() context.Context
func (*SocketServer) In ¶
func (s *SocketServer) In() <-chan rest.IRequestIn
func (*SocketServer) IsStream ¶
func (s *SocketServer) IsStream() bool
func (*SocketServer) SendMessage ¶
func (s *SocketServer) SendMessage(req rest.IRequestOut) (<-chan *rest.RequestStream, error)
func (*SocketServer) SetAuth ¶
func (s *SocketServer) SetAuth(auth json.Map)
func (*SocketServer) SetClientData ¶
func (s *SocketServer) SetClientData(key string, data any)
Click to show internal directories.
Click to hide internal directories.