Documentation ¶
Overview ¶
Package classify implements a tlsutil.Classifier client and a ready to use service component.
This package is a work in progress and makes no API stability promises.
Index ¶
Constants ¶
const ( APIName = "luids.tlsutil" APIVersion = "v1" APIService = "Classify" )
Constants for api description.
Variables ¶
This section is empty.
Functions ¶
func ClientBuilder ¶
func ClientBuilder(opt ...ClientOption) apiservice.BuildFn
ClientBuilder returns builder function
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 grpc Client.
func (*Client) ClassifyConnections ¶
func (c *Client) ClassifyConnections(ctx context.Context, requests []*tlsutil.ConnectionData) ([]tlsutil.ClassifyResponse, error)
ClassifyConnections implements tlsutil.Classifier.
type ClientOption ¶
type ClientOption func(*clientOpts)
ClientOption encapsules options for client.
func CloseConnection ¶
func CloseConnection(b bool) ClientOption
CloseConnection option closes grpc connection on close.
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(c tlsutil.Classifier, opt ...ServiceOption) *Service
NewService returns a new Service for the cheker.
func (*Service) Connections ¶
func (s *Service) Connections(ctx context.Context, in *pb.ClassifyConnectionsRequest) (*pb.ClassifyConnectionsResponse, error)
Connections implements grpc api.
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.