server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultServer

func DefaultServer() (r *rpcx_server.Server)

func NewRpcxServer

func NewRpcxServer(cfg *Cfg) (r *srv, err error)

func SafeServer

func SafeServer(name string) (r *srv, err error)

func Server

func Server(name string) (r *srv)

func StartDefaultServer

func StartDefaultServer(rcvr interface{}) (err error)

func StartServer

func StartServer(name string, rcvr interface{}) (err error)

func StopDefaultServer

func StopDefaultServer() (err error)

func StopServer

func StopServer(name string) (err error)

Types

type Cfg

type Cfg struct {
	// dial
	DialAddr         string        `toml:"addr"`
	DialReadTimeout  time.Duration `toml:"read_timeout"`
	DialWriteTimeout time.Duration `toml:"write_timeout"`

	// register, only support zookeeper
	RegisterServers        []string      `toml:"register_servers"`
	RegisterBasePath       string        `toml:"register_base_path"`
	RegisterUpdateInterval time.Duration `toml:"register_update_interval"`
}

type ServiceImpl

type ServiceImpl struct{}

func (*ServiceImpl) Before

func (this *ServiceImpl) Before(header *pb.Header) (log *logs.SessLog)

func (*ServiceImpl) Ping

func (this *ServiceImpl) Ping(ctx context.Context, req *pb.Ping_Req, resp *pb.Ping_Resp) (err error)

Jump to

Keyboard shortcuts

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