gate

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidGID         = link.ErrInvalidGID
	ErrInvalidNID         = link.ErrInvalidNID
	ErrInvalidMessage     = link.ErrInvalidMessage
	ErrInvalidArgument    = link.ErrInvalidArgument
	ErrInvalidSessionKind = link.ErrInvalidSessionKind
	ErrNotFoundUserSource = link.ErrNotFoundUserSource
	ErrReceiveTargetEmpty = link.ErrReceiveTargetEmpty
)

Functions

This section is empty.

Types

type Gate

type Gate struct {
	component.Base
	// contains filtered or unexported fields
}

func NewGate

func NewGate(opts ...Option) *Gate

func (*Gate) Destroy

func (g *Gate) Destroy()

Destroy 销毁组件

func (*Gate) Init

func (g *Gate) Init()

Init 初始化

func (*Gate) Name

func (g *Gate) Name() string

Name 组件名称

func (*Gate) Proxy added in v0.0.23

func (n *Gate) Proxy() *Proxy

Proxy 获取节点代理

func (*Gate) Start

func (g *Gate) Start()

Start 启动组件

type Option

type Option func(o *options)

func WithCatServer added in v0.0.23

func WithCatServer(catServer *cat.Server) Option

WithCatServer 设置cat server

func WithContext

func WithContext(ctx context.Context) Option

WithContext 设置上下文

func WithID

func WithID(id string) Option

WithID 设置实例ID

func WithLocator

func WithLocator(locator locate.Locator) Option

WithLocator 设置用户定位器

func WithName

func WithName(name string) Option

WithName 设置实例名称

func WithPromServer added in v0.0.23

func WithPromServer(promServer *prometheus.PromServer) Option

WithPromServer 设置prom server

func WithReceiveHook added in v0.0.15

func WithReceiveHook(receiveHook ...hook.ReceiveHook) Option

WithReceiveHook 设置Gate收到消息时的Hook函数

func WithRegistry

func WithRegistry(r registry.Registry) Option

WithRegistry 设置服务注册器

func WithServer

func WithServer(server network.Server) Option

WithServer 设置服务器

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout 设置RPC调用超时时间

func WithTransporter

func WithTransporter(transporter transport.Transporter) Option

WithTransporter 设置消息传输器

func WithWsServer added in v0.0.36

func WithWsServer(server network.Server) Option

WithWsServer 设置websocket 服务器

type Proxy added in v0.0.23

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

func (*Proxy) GetId added in v0.0.23

func (p *Proxy) GetId() string

GetId 获取Gate Id

func (*Proxy) GetServerIP added in v0.0.23

func (p *Proxy) GetServerIP() string

GetServerIP 获取GRPC SERVER IP

func (*Proxy) GetServerPort added in v0.0.23

func (p *Proxy) GetServerPort() string

GetServerPort 获取GRPC SERVER Port

func (*Proxy) GetSession added in v0.0.23

func (p *Proxy) GetSession() *session.Session

GetSession 获取Gate持有Session

Jump to

Keyboard shortcuts

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