cross

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ServerId int64  `json:"server_id"`
	Packet   []byte `json:"packet"`
}

type Nats

type Nats struct {
	// contains filtered or unexported fields
}

func NewNats

func NewNats(url string, options ...NatsOption) *Nats

func (*Nats) Init

func (slf *Nats) Init(server *server.Server, packetHandle func(serverId int64, packet []byte)) (err error)

func (*Nats) PushMessage

func (slf *Nats) PushMessage(serverId int64, packet []byte) error

func (*Nats) Release

func (slf *Nats) Release()

type NatsOption

type NatsOption func(n *Nats)

func WithNatsConn

func WithNatsConn(conn *nats.Conn) NatsOption

WithNatsConn 指定通过特定的连接创建

  • 这将导致 WithNatsOptions 失效

func WithNatsOptions

func WithNatsOptions(options ...nats.Option) NatsOption

WithNatsOptions 通过nats自带的可选项创建连接

func WithNatsSubject

func WithNatsSubject(subject string) NatsOption

WithNatsSubject 通过对应的主题名称创建

  • 默认为:MINOTAUR_CROSS

Jump to

Keyboard shortcuts

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