Documentation ¶
Overview ¶
Package finder implements a dnsutil.Finder client and a ready to use service component.
This package is a work in progress and makes no API stability promises.
Index ¶
- Constants
- func ClientBuilder(opt ...ClientOption) apiservice.BuildFn
- func RegisterServer(server *grpc.Server, service *Service)
- func ServiceName() string
- type Client
- func (c *Client) API() string
- func (c *Client) Close() error
- func (c *Client) GetResolv(ctx context.Context, id uuid.UUID) (dnsutil.ResolvData, bool, error)
- func (c *Client) ListResolvs(ctx context.Context, filters []dnsutil.ResolvsFilter, rev bool, max int, ...) ([]dnsutil.ResolvData, string, error)
- func (c *Client) Ping() error
- type ClientOption
- type Service
- type ServiceOption
Constants ¶
const ( APIName = "luids.dnsutil" APIVersion = "v1" APIService = "Finder" )
Constants for api description.
Variables ¶
This section is empty.
Functions ¶
func ClientBuilder ¶
func ClientBuilder(opt ...ClientOption) apiservice.BuildFn
ClientBuilder returns builder function for the apiservice
func RegisterServer ¶
RegisterServer registers a service in the grpc server.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a grpc client.
func NewClient ¶
func NewClient(conn *grpc.ClientConn, opt ...ClientOption) *Client
NewClient returns a new client.
func (*Client) ListResolvs ¶
func (c *Client) ListResolvs(ctx context.Context, filters []dnsutil.ResolvsFilter, rev bool, max int, next string) ([]dnsutil.ResolvData, string, error)
ListResolvs implements dnsutil.Finder interface
type ClientOption ¶
type ClientOption func(*clientOpts)
ClientOption encapsules options for client.
func CloseConnection ¶
func CloseConnection(b bool) ClientOption
CloseConnection option closes grpc connection on shutdown.
func SetLogger ¶
func SetLogger(l yalogi.Logger) ClientOption
SetLogger option allows set a custom logger.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements a grpc service wrapper.
func NewService ¶
func NewService(f dnsutil.Finder, opt ...ServiceOption) *Service
NewService returns a new Service.
func (*Service) GetResolv ¶
func (s *Service) GetResolv(ctx context.Context, req *pb.GetResolvRequest) (*pb.GetResolvResponse, error)
GetResolv implements grpc interface.
func (*Service) ListResolvs ¶
func (s *Service) ListResolvs(ctx context.Context, req *pb.ListResolvsRequest) (*pb.ListResolvsResponse, error)
ListResolvs implements grpc interface.
type ServiceOption ¶
type ServiceOption func(*serviceOpts)
ServiceOption is used for service configuration.
func SetServiceLogger ¶
func SetServiceLogger(l yalogi.Logger) ServiceOption
SetServiceLogger option allows set a custom logger.