Versions in this module Expand all Collapse all v0 v0.2.0 Jul 8, 2021 Changes in this version + const DefaultRegistryEndpoint + const DefaultSegment + const DefaultServerName + const DefaultServerPort + const DirectScheme + const ElsaScheme + const RenewTimeDuration + const RetryTimeDuration + const TimeoutDuration + func BuildTarget(segment, serviceName string) string + type BuilderAction func(server *grpc.Server) (serverNames []string) + type DirectResolver struct + func NewDirectResolverWithEndpoints(endpoints []string) *DirectResolver + func (r *DirectResolver) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) + func (r *DirectResolver) Close() + func (r *DirectResolver) ResolveNow(opts resolver.ResolveNowOptions) + func (r *DirectResolver) Scheme() string + type ElsaResolver struct + func NewElsaResolver(serviceName string, cli resolver.ClientConn, registryStub *RegistryStub) *ElsaResolver + func (r *ElsaResolver) Close() + func (r *ElsaResolver) ResolveNow(opts resolver.ResolveNowOptions) + type ElsaResolverBuilder struct + func NewElsaResolverBuilder(stub *RegistryStub) *ElsaResolverBuilder + func (r *ElsaResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) + func (r *ElsaResolverBuilder) Scheme() string + type ElsaServer struct + func NewElsaServer(options ...ServerOption) (*ElsaServer, error) + func (s *ElsaServer) BuildStub(serviceName string, callback func(cc *grpc.ClientConn) interface{}) interface{} + func (s *ElsaServer) Init(action InitAction) + func (s *ElsaServer) Start() error + type InitAction func(server *grpc.Server) (serverNames []string) + type ManagedSentinel struct + func NewManagedSentinel(serverPort int32, registryStub *RegistryStub) *ManagedSentinel + func (m *ManagedSentinel) Close() + func (m *ManagedSentinel) PushService(serviceName string) + type RegistryStub struct + func NewRegistryStub(segment string, endpoints []string) (*RegistryStub, error) + func (r *RegistryStub) Cancel(ctx context.Context, serviceName, ip string, port int32) (bool, error) + func (r *RegistryStub) Fetch(cxt context.Context, serviceName string) ([]*pb.ServiceInstance, error) + func (r *RegistryStub) GetSegment() string + func (r *RegistryStub) Register(ctx context.Context, serviceName, ip string, port int32) (bool, error) + func (r *RegistryStub) Renew(ctx context.Context, serviceName, ip string, port int32) (bool, error) + type Sentinel struct + type ServerOption func(options *ServerOptions) + func WithName(name string) ServerOption + func WithRegistryStub(stub *RegistryStub) ServerOption + func WithServerPort(serverPort int32) ServerOption + type ServerOptions struct v0.1.0 Jun 11, 2021