resolver

package
v2.0.31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

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

func NewMiniResolverResolverBuilder(miniResolverclient *MiniResolver, checkTimeout time.Duration, notFoundTimeout time.Duration, logger zLogger.ZLogger) resolver.Builder

func RegisterResolver

func RegisterResolver(miniresolverClient *MiniResolver, checkTimeout, notFoundTimeout time.Duration, logger zLogger.ZLogger)

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 (c *MiniResolver) NewServer(addr string, domains []string, single bool) (*Server, error)

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)

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

func (*Server) GetAddr

func (s *Server) GetAddr() string

func (*Server) Shutdown

func (s *Server) Shutdown() error

func (*Server) Startup

func (s *Server) Startup()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL