Versions in this module Expand all Collapse all v1 v1.3.0 Oct 30, 2023 Changes in this version + func ConsulRegister(conf ServerConfig) (server.Plugin, error) + func CustomOptions(f func() client.Option) + func EtcdV3Register(conf ServerConfig) (server.Plugin, error) + func ZooKeeperRegister(conf ServerConfig) (server.Plugin, error) + type AuthFunc func(ctx context.Context, token string) error + type BalanceModel int + const ConsistentHash + const NetworkQuality + const Random + const RoundRobin + type ClientConfig struct + BalanceModel BalanceModel + BasePath string + ClientName string + FailRetryModel FailRetryModel + PoolSize int + RegisterPlugin RegisterPluginType + RegisterServers []string + type ClientLoggerPlugin struct + func (p *ClientLoggerPlugin) PostCall(ctx context.Context, servicePath, serviceMethod string, args interface{}) error + type ClientPool struct + func NewRPCClient(conf ClientConfig) (c *ClientPool, err error) + func (c *ClientPool) Client(auth ...string) *client.OneClient + type FailRetryModel int + const FailFast + const FailOver + const FailTry + type RPCHeader struct + func Header() *RPCHeader + func (h *RPCHeader) Bool(ctx context.Context, key string) (bool, error) + func (h *RPCHeader) BoolDefault(ctx context.Context, key string, def bool) bool + func (h *RPCHeader) Int(ctx context.Context, key string) (int, error) + func (h *RPCHeader) Int32(ctx context.Context, key string) (int32, error) + func (h *RPCHeader) Int32Default(ctx context.Context, key string, def int32) int32 + func (h *RPCHeader) Int64(ctx context.Context, key string) (int64, error) + func (h *RPCHeader) Int64Default(ctx context.Context, key string, def int64) int64 + func (h *RPCHeader) IntDefault(ctx context.Context, key string, def int) int + func (h *RPCHeader) Set(ctx context.Context, header map[string]string) context.Context + func (h *RPCHeader) Value(ctx context.Context, key string) string + type RegisterPluginType string + const Con + const ETCD + const ZK + type Server struct + Name string + func NewRPCServer(conf ServerConfig, plugins ...server.Plugin) (rpc *Server, err error) + func (s *Server) RegisterAuthFunc(authFunc AuthFunc) + func (s *Server) Start() + type ServerConfig struct + Addr string + BasePath string + Handle interface{} + RegisterPlugin RegisterPluginType + RegisterServers []string + ServerName string + type ServerLoggerPlugin struct + func (p *ServerLoggerPlugin) PostWriteResponse(ctx context.Context, req *protocol.Message, res *protocol.Message, err error) error + func (p *ServerLoggerPlugin) PreHandleRequest(ctx context.Context, r *protocol.Message) error