Versions in this module Expand all Collapse all v1 v1.0.1 Oct 31, 2023 v1.0.0 Oct 31, 2023 Changes in this version + type AsyncClient struct + func NewAsyncClient(client asyncClient[T, P]) *AsyncClient[T, P] + func (c *AsyncClient[T, P]) Emit(event string, data []byte) (*Stream[T], error) + func (c *AsyncClient[T, P]) JsonEmit(event string, data any) (*Stream[T], error) + func (c *AsyncClient[T, P]) ProtoBufEmit(event string, data proto.Message) (*Stream[T], error) + func (s AsyncClient) Code() uint32 + func (s AsyncClient) Conn() T + func (s AsyncClient) Event() string + func (s AsyncClient) MessageID() uint64 + func (s AsyncClient) MessageType() byte + func (s AsyncClient) Respond(data any) error + func (s AsyncClient) SetCode(code uint32) + func (s AsyncClient) SetMessageID(messageID uint64) + func (s AsyncClient) SetMessageType(messageType byte) + type Emitter interface + Code func() uint32 + Conn func() T + Emit func(event string, data []byte) error + Event func() string + JsonEmit func(event string, data any) error + MessageID func() uint64 + MessageType func() byte + ProtoBufEmit func(event string, data proto.Message) error + SetCode func(code uint32) + SetMessageID func(messageID uint64) + SetMessageType func(messageType byte) + func NewSender(conn T) Emitter[T] + type Packer interface + Pack func(order uint32, messageType byte, code uint32, messageID uint64, route []byte, ...) error + Push func(msg []byte) error + UnPack func(msg []byte) (order uint32, messageType byte, code uint32, messageID uint64, route []byte, ...) + type Params map[string]string + func (ps Params) Get(name string) string + type Server struct + func NewAsyncServer(server server[T, P]) *Server[T, P] + func (s *Server[T, P]) Sender(fd int64) (*ServerSender[T, P], error) + type ServerSender struct + func (s *ServerSender[T, P]) Emit(event string, data []byte) (*Stream[T], error) + func (s *ServerSender[T, P]) JsonEmit(event string, data any) (*Stream[T], error) + func (s *ServerSender[T, P]) ProtoBufEmit(event string, data proto.Message) (*Stream[T], error) + func (s ServerSender) Code() uint32 + func (s ServerSender) Conn() T + func (s ServerSender) Event() string + func (s ServerSender) MessageID() uint64 + func (s ServerSender) MessageType() byte + func (s ServerSender) Respond(data any) error + func (s ServerSender) SetCode(code uint32) + func (s ServerSender) SetMessageID(messageID uint64) + func (s ServerSender) SetMessageType(messageType byte) + type Stream struct + Context kitty.Context + Logger kitty.Logger + Params Params + Time time.Time + func NewStream(conn T, order uint32, messageType byte, code uint32, id uint64, route []byte, ...) *Stream[T] + func (s *Stream[T]) Data() []byte + func (s *Stream[T]) Emit(event string, data []byte) error + func (s *Stream[T]) JsonEmit(event string, data any) error + func (s *Stream[T]) ProtoBufEmit(event string, data proto.Message) error + func (s *Stream[T]) Respond(data any) error + func (s Stream) Code() uint32 + func (s Stream) Conn() T + func (s Stream) Event() string + func (s Stream) MessageID() uint64 + func (s Stream) MessageType() byte + func (s Stream) SetCode(code uint32) + func (s Stream) SetMessageID(messageID uint64) + func (s Stream) SetMessageType(messageType byte)