Documentation ¶
Index ¶
- Constants
- func DoPing(pinger GRPCPinger, logger zLogger.ZLogger)
- func NewClient[V any](c *MiniResolver, newClientFunc func(conn grpc.ClientConnInterface) V, ...) (V, error)
- func NewClientCloser[V any](c *MiniResolver, newClientFunc func(conn grpc.ClientConnInterface) V, ...) (V, io.Closer, error)
- func NewClients[V any](c *MiniResolver, newClientFunc func(conn grpc.ClientConnInterface) V, ...) (map[string]V, error)
- func NewMiniResolverResolverBuilder(miniResolverclient *MiniResolver, checkTimeout time.Duration, ...) resolver.Builder
- func RegisterResolver(miniresolverClient *MiniResolver, checkTimeout, notFoundTimeout time.Duration, ...)
- type GRPCPinger
- type MiniResolver
- func (c *MiniResolver) Close() error
- func (c *MiniResolver) NewServer(addr string, domains []string, single bool) (*Server, error)
- func (c *MiniResolver) RefreshResolver(target string)
- func (c *MiniResolver) SetDialOpts(options ...grpc.DialOption)
- func (c *MiniResolver) SetServerOpts(options ...grpc.ServerOption)
- func (c *MiniResolver) UnwatchService(target string)
- func (c *MiniResolver) WatchService(target string, reloadChannel chan<- bool)
- type Server
Constants ¶
View Source
const RESOLVERSCHEMA = "miniresolver"
Variables ¶
This section is empty.
Functions ¶
func DoPing ¶
func DoPing(pinger GRPCPinger, logger zLogger.ZLogger)
func NewClient ¶
func NewClient[V any](c *MiniResolver, newClientFunc func(conn grpc.ClientConnInterface) V, serviceName, domain string) (V, error)
func NewClientCloser ¶
func NewClientCloser[V any](c *MiniResolver, newClientFunc func(conn grpc.ClientConnInterface) V, serviceName, domain string) (V, io.Closer, error)
func NewClients ¶
func NewClients[V any](c *MiniResolver, newClientFunc func(conn grpc.ClientConnInterface) V, serviceName string, domains []string) (map[string]V, error)
func NewMiniResolverResolverBuilder ¶
Types ¶
type GRPCPinger ¶
type GRPCPinger interface {
Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*genericproto.DefaultResponse, error)
}
type MiniResolver ¶
type MiniResolver struct { pb.MiniResolverClient // contains filtered or unexported fields }
func NewMiniresolverClient ¶
func NewMiniresolverClient(serverAddr string, clientMap map[string]string, clientTLSConfig, serverTLSConfig *tls.Config, resolverTimeout, resolverNotFoundTimeout time.Duration, logger zLogger.ZLogger, dialOpts ...grpc.DialOption) (*MiniResolver, error)
NewMiniresolverClient creates a new miniresolver client serverAddr: network address of the miniresolver server can be empty for clientMap only clientMap: map of service names to network addresses can be nil clientTLSConfig: tls configuration for the client can be nil for server only or insecure serverTLSConfig: tls configuration for the server can be nil for client only or insecure resolverTimeout: timeout for resolver recall resolverNotFoundTimeout: timeout for resolver not found for recall if resolver not found logger: logger opts: additional grpc dial options
func (*MiniResolver) Close ¶
func (c *MiniResolver) Close() error
func (*MiniResolver) NewServer ¶
func (*MiniResolver) RefreshResolver ¶
func (c *MiniResolver) RefreshResolver(target string)
func (*MiniResolver) SetDialOpts ¶
func (c *MiniResolver) SetDialOpts(options ...grpc.DialOption)
func (*MiniResolver) SetServerOpts ¶
func (c *MiniResolver) SetServerOpts(options ...grpc.ServerOption)
func (*MiniResolver) UnwatchService ¶
func (c *MiniResolver) UnwatchService(target string)
func (*MiniResolver) WatchService ¶
func (c *MiniResolver) WatchService(target string, reloadChannel chan<- bool)
Click to show internal directories.
Click to hide internal directories.