Documentation
¶
Index ¶
- func CheckError(err error)
- func RecordPlayerOnlineStatus(online bool)
- type HashCodec
- type INetClient
- type NetOption
- func WithCodec(codec codec.Codec) NetOption
- func WithHandler(handler ...netty.Handler) NetOption
- func WithLbName(lbName string) NetOption
- func WithReadTimeOut(readTimeOut time.Duration, readTimeOutFunc func(ctx netty.EventContext)) NetOption
- func WithWriteTimeOut(writeTimeOut time.Duration, writeTimeOutFunc func(ctx netty.EventContext)) NetOption
- type NetServer
- type PrometheusCodec
- func (*PrometheusCodec) CodecName() string
- func (c *PrometheusCodec) HandleActive(ctx netty.ActiveContext)
- func (c *PrometheusCodec) HandleInactive(ctx netty.InactiveContext, ex netty.Exception)
- func (c *PrometheusCodec) HandleRead(ctx netty.InboundContext, message netty.Message)
- func (c *PrometheusCodec) HandleWrite(ctx netty.OutboundContext, message netty.Message)
- type ProtobufCodec
- type SymmetricCryptoCodec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
func CheckError(err error)
Types ¶
type HashCodec ¶
type HashCodec struct { // 返回 hash算法 HashAlgoAndInData func(ctx netty.HandlerContext, message netty.Message) (uint, []byte) // 重新写入原生对象 SetHashOutData func(ctx netty.HandlerContext, message netty.Message, data []byte) netty.Message }
func (*HashCodec) HandleRead ¶
func (c *HashCodec) HandleRead(ctx netty.InboundContext, message netty.Message)
func (*HashCodec) HandleWrite ¶
func (c *HashCodec) HandleWrite(ctx netty.OutboundContext, message netty.Message)
type INetClient ¶
type INetClient interface { Connect(url string, opts ...retry.Option) error Shutdown() Write(msg any) ChooseOne() netty.Channel }
func DefaultNetClient ¶
func DefaultNetClient(ops ...NetOption) INetClient
func NetClient ¶
func NetClient(ops ...NetOption) INetClient
type NetOption ¶
type NetOption func(options *netOptions)
func WithHandler ¶
func WithHandler(handler ...netty.Handler) NetOption
func WithLbName ¶
func WithReadTimeOut ¶
func WithWriteTimeOut ¶
type NetServer ¶
type NetServer struct {
// contains filtered or unexported fields
}
func NewNetServer ¶
type PrometheusCodec ¶
type PrometheusCodec struct{}
func (*PrometheusCodec) CodecName ¶
func (*PrometheusCodec) CodecName() string
func (*PrometheusCodec) HandleActive ¶
func (c *PrometheusCodec) HandleActive(ctx netty.ActiveContext)
func (*PrometheusCodec) HandleInactive ¶
func (c *PrometheusCodec) HandleInactive(ctx netty.InactiveContext, ex netty.Exception)
func (*PrometheusCodec) HandleRead ¶
func (c *PrometheusCodec) HandleRead(ctx netty.InboundContext, message netty.Message)
func (*PrometheusCodec) HandleWrite ¶
func (c *PrometheusCodec) HandleWrite(ctx netty.OutboundContext, message netty.Message)
type ProtobufCodec ¶
func (*ProtobufCodec) CodecName ¶
func (*ProtobufCodec) CodecName() string
func (*ProtobufCodec) HandleRead ¶
func (c *ProtobufCodec) HandleRead(ctx netty.InboundContext, message netty.Message)
func (*ProtobufCodec) HandleWrite ¶
func (c *ProtobufCodec) HandleWrite(ctx netty.OutboundContext, message netty.Message)
type SymmetricCryptoCodec ¶
type SymmetricCryptoCodec struct { // 返回 加密算法和secret ,iv CryptoAlgoAndSecret func(ctx netty.HandlerContext, message netty.Message) (string, []byte, []byte) // 返回要解密或者加密的数据 CryptoData func(ctx netty.HandlerContext, message netty.Message) []byte // 重新写入原生对象 SetCryptoData func(ctx netty.HandlerContext, message netty.Message, data []byte) netty.Message }
func (*SymmetricCryptoCodec) CodecName ¶
func (*SymmetricCryptoCodec) CodecName() string
func (*SymmetricCryptoCodec) HandleRead ¶
func (c *SymmetricCryptoCodec) HandleRead(ctx netty.InboundContext, message netty.Message)
func (*SymmetricCryptoCodec) HandleWrite ¶
func (c *SymmetricCryptoCodec) HandleWrite(ctx netty.OutboundContext, message netty.Message)
Click to show internal directories.
Click to hide internal directories.