boots

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve added in v1.0.27

func Serve(opts ...Option)

Types

type ByteOrder added in v1.0.29

type ByteOrder int8

type Option added in v1.0.27

type Option func(*Options)

func WithByteOrderLittleEndian added in v1.0.29

func WithByteOrderLittleEndian() Option

使用小端字节序

func WithHttpAddr added in v1.0.27

func WithHttpAddr(httpAddr string, opts ...*RouterOption) Option

WithHttpAddr sets the independent http address

func WithHttpHungup added in v1.0.32

func WithHttpHungup() Option

func WithInitializer added in v1.0.27

func WithInitializer(initializer channel.ChannelInitializer) Option

func WithKeyLengthInclude added in v1.0.31

func WithKeyLengthInclude() Option

包长度是否包含自己的长度

func WithLogger added in v1.0.27

func WithLogger(l logger.Logger) Option

func WithMsgType added in v1.0.27

func WithMsgType(msgType int) Option

func WithPacketBytesCount added in v1.0.31

func WithPacketBytesCount(packetBytesCount int32) Option

消息长度占用字节数

func WithReadLimit added in v1.0.29

func WithReadLimit(readLimit int32) Option

连接读取消息长度限制

func WithReadTimeOut added in v1.0.29

func WithReadTimeOut(readTimeOut int32) Option

连接读取消息超时时间

func WithSkipPacketBytesCount added in v1.0.31

func WithSkipPacketBytesCount() Option

跳过包长度

func WithTCPAddr added in v1.0.27

func WithTCPAddr(addr string) Option

WithTCPAddr sets the listen address which is used to establish connection between cluster members. Will select an available port automatically if no member address setting and panic if no available port

func WithTLSConfig added in v1.0.27

func WithTLSConfig(certificate, key string) Option

WithTLSConfig sets the `key` and `certificate` of TLS

func WithWriteTimeOut added in v1.0.29

func WithWriteTimeOut(writeTimeOut int32) Option

连接写入消息超时时间

type Options added in v1.0.27

type Options struct {
	TCPAddr        string
	HttpAddr       string
	TLSCertificate string // crt for tls
	TLSKey         string // key for tls

	Initializer   channel.ChannelInitializer
	Logger        logger.Logger
	RouterOptions map[string]*Options // 分组配置 (key:routerPath, value:options)
	MsgType       int                 // WebSocket 消息类型
	HttpHungup    bool                // Http请求是否挂起
	//// param for conn
	ByteOrder            ByteOrder // 字节序
	ReadTimeOut          int32     // 连接读取消息超时时间
	WriteTimeOut         int32     // 连接写入消息超时时间
	ReadLimit            int32     // 连接读取消息长度限制
	PacketBytesCount     int32     // 消息长度占用字节数
	LengthInclude        bool      // 包长度是否包含自己的长度
	SkipPacketBytesCount bool      // 跳过包长度
}

Options contains some configurations for current node

type RouterOption added in v1.0.32

type RouterOption struct {
	RouterPath string
	Opts       *Options
}

func WithRouterOption added in v1.0.32

func WithRouterOption(router string, opts ...Option) *RouterOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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