Documentation ¶
Index ¶
- type Option
- type Server
- func (s *Server) GetEtcdClient() *clientv3.Client
- func (s *Server) GetGrpcServer() *grpc.Server
- func (s *Server) GetService() *Service
- func (s *Server) Init() error
- func (s *Server) RegisterService() error
- func (s *Server) ServiceDiscovery(name string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func (s *Server) Start() error
- func (s *Server) Stop()
- func (s *Server) UnRegisterService() error
- type Service
- type ServiceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(s *Server)
func WithDialTimeout ¶ added in v0.0.5
func WithEndpoints ¶ added in v0.0.5
func WithEtcdConfig ¶ added in v0.0.5
func WithGrpcListener ¶ added in v0.0.5
func WithGrpcServer ¶ added in v0.0.5
func WithService ¶ added in v0.0.5
type Server ¶ added in v0.0.5
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetEtcdClient ¶ added in v0.0.5
GetEtcdClient 获取etcd client
func (*Server) GetGrpcServer ¶ added in v0.0.5
GetGrpcServer 获取grpc server
func (*Server) GetService ¶ added in v0.0.5
GetService 获取service
func (*Server) RegisterService ¶ added in v0.0.5
RegisterService 注册服务
func (*Server) ServiceDiscovery ¶ added in v0.0.5
func (s *Server) ServiceDiscovery(name string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
ServiceDiscovery 服务发现
func (*Server) UnRegisterService ¶ added in v0.0.5
UnRegisterService 注销服务
type Service ¶
Service 服务
func NewService ¶ added in v0.0.5
func NewService(opts ...ServiceOption) *Service
type ServiceOption ¶ added in v0.0.5
type ServiceOption func(s *Service)
func WithServiceAddr ¶ added in v0.0.5
func WithServiceAddr(serviceAddr string) ServiceOption
func WithServiceName ¶ added in v0.0.5
func WithServiceName(serviceName string) ServiceOption
Click to show internal directories.
Click to hide internal directories.