serverplugin

package
v0.0.0-...-3cbf502 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisRegisterPlugin

type RedisRegisterPlugin struct {
	// service address, for example, tcp@127.0.0.1:8972, quic@127.0.0.1:1234
	ServiceAddress string
	// redis addresses
	RedisServers []string
	// base path for rpcx server, for example com/example/rpcx
	BasePath string
	Metrics  metrics.Registry
	// Registered services
	Services []string

	UpdateInterval time.Duration

	Options *store.Config
	// contains filtered or unexported fields
}

RedisRegisterPlugin implements redis registry.

func (*RedisRegisterPlugin) HandleConnAccept

func (p *RedisRegisterPlugin) HandleConnAccept(conn net.Conn) (net.Conn, bool)

HandleConnAccept handles connections from clients

func (*RedisRegisterPlugin) PreCall

func (p *RedisRegisterPlugin) PreCall(_ context.Context, _, _ string, args interface{}) (interface{}, error)

PreCall handles rpc call from clients

func (*RedisRegisterPlugin) Register

func (p *RedisRegisterPlugin) Register(name string, rcvr interface{}, metadata string) (err error)

Register handles registering event. this service is registered at BASE/serviceName/thisIpAddress node

func (*RedisRegisterPlugin) Start

func (p *RedisRegisterPlugin) Start() error

Start starts to connect redis cluster

func (*RedisRegisterPlugin) Stop

func (p *RedisRegisterPlugin) Stop() error

Stop unregister all services.

func (*RedisRegisterPlugin) Unregister

func (p *RedisRegisterPlugin) Unregister(name string) (err error)

Jump to

Keyboard shortcuts

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