Versions in this module Expand all Collapse all v0 v0.1.0 Jan 18, 2022 v0.0.1 Jan 18, 2022 Changes in this version + const RegistryTypeConsul + const RegistryTypeEtcdV3 + const RegistryTypeMDNS + const RegistryTypeMultipleServers + const RegistryTypePeer2Peer + const RegistryTypeRedis + var ErrorAddress = errors.New("address error") + var ErrorSerivceNotExists = errors.New("service not exists") + var ErrorServerClosed = errors.New("server closed") + var ErrorUnsupportedRegistryType = errors.New("unsupported registry type") + func GetRemoteAddr(ctx *share.Context) string + func GetRequestValue(ctx *share.Context, key string) string + func GetResponseValue(ctx *share.Context, key string) string + func SetLogger(l log.Logger) + func SetRequestValue(ctx *share.Context, key string, value string) + func SetResponseValue(ctx *share.Context, key string, value string) + type ClientManager struct + func NewServiceManager(cfg *ClientManagerConfig) (*ClientManager, error) + func (m *ClientManager) AddService(name, servicePath string) error + func (m *ClientManager) Close(c *client.XClientPool) error + func (m *ClientManager) GetClient(name string) (client.XClient, error) + func (m *ClientManager) GetServices(name string) map[string]string + func (m *ClientManager) Release() error + func (m *ClientManager) SetClientFailMode(name string, mode client.FailMode) + func (m *ClientManager) SetClientOption(name string, option client.Option) + func (m *ClientManager) SetClientSelectMode(name string, mode client.SelectMode) + type ClientManagerConfig struct + BasePath string + CircuitBreakerFailureThreshold uint64 + CircuitBreakerRestoreWindow time.Duration + Endpoints string + MaxConnsPerService int + Type string + type Server struct + func New(cfg *ServerConfig, plugins ...server.Plugin) (*Server, error) + func (s *Server) Close() error + func (s *Server) RegisterFileTransferService(name string, addr string, handler server.FileTransferHandler, ...) error + func (s *Server) RegisterService(name string, obj interface{}) error + func (s *Server) RegisterStreamService(name string, addr string, streamHandler server.StreamHandler, ...) error + func (s *Server) Run() error + func (s *Server) Shutdown(ctx context.Context) error + type ServerConfig struct + Address string + RateLimitingConnectCapacity int64 + RateLimitingConnectFillInterval time.Duration + RateLimitingRequestCapacity int64 + RateLimitingRequestFillInterval time.Duration + RegistryBasePath string + RegistryEndpoints string + RegistryInterval time.Duration + RegistryType string + type Service struct