server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRpcxServer

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

func RpcxServer added in v0.2.0

func RpcxServer(name string) (r *rpcx_server.Server)

func SafeServer

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

func Server

func Server(name string) (r *srv)

func StartServer

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

func StartServerAndGrpc added in v0.1.4

func StartServerAndGrpc(name string, rcvr interface{}, grcvr func(*grpc.Server)) (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"`

	EnableGrpc bool `toml:"enable_grpc"`

	// register
	Register string `toml:"register"`

	// zookeeper register
	RegisterZkServers        []string      `toml:"register_zk_servers"`
	RegisterZkBasePath       string        `toml:"register_zk_basepath"`
	RegisterZkUpdateInterval time.Duration `toml:"register_zk_update_interval"`

	// nacos register
	RegisterNcServers     []string `toml:"register_nc_servers"`
	RegisterNcNamespaceId string   `toml:"register_nc_namespace_id"`
	RegisterNcCacheDir    string   `toml:"register_nc_cache_dir"`
	RegisterNcLogDir      string   `toml:"register_nc_log_dir"`
	RegisterNcLogLevel    string   `toml:"register_nc_log_level"`
	RegisterNcAccessKey   string   `toml:"register_nc_access_key"`
	RegisterNcSecretKey   string   `toml:"register_nc_secret_key"`
}

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