Documentation
¶
Overview ¶
Package archive implements a tlsutil.Archive 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) Ping() error
- func (c *Client) SaveCertificate(ctx context.Context, data *tlsutil.CertificateData) (string, error)
- func (c *Client) SaveConnection(ctx context.Context, data *tlsutil.ConnectionData) (string, error)
- func (c *Client) StoreRecord(data *tlsutil.RecordData) error
- type ClientOption
- type Service
- func (s *Service) SaveCertificate(ctx context.Context, req *pb.SaveCertificateRequest) (*pb.SaveCertificateResponse, error)
- func (s *Service) SaveConnection(ctx context.Context, req *pb.SaveConnectionRequest) (*pb.SaveConnectionResponse, error)
- func (s *Service) StreamRecords(stream pb.Archive_StreamRecordsServer) error
- type ServiceOption
Constants ¶
const ( APIName = "luids.tlsutil" APIVersion = "v1" APIService = "Archive" )
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) SaveCertificate ¶
func (c *Client) SaveCertificate(ctx context.Context, data *tlsutil.CertificateData) (string, error)
SaveCertificate implements tlsutil.Archiver interface.
func (*Client) SaveConnection ¶
SaveConnection implements tlsutil.Archiver interface.
func (*Client) StoreRecord ¶
func (c *Client) StoreRecord(data *tlsutil.RecordData) error
StoreRecord implements tlsutil.Archiver 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(a tlsutil.Archiver, opt ...ServiceOption) *Service
NewService returns a new Service.
func (*Service) SaveCertificate ¶
func (s *Service) SaveCertificate(ctx context.Context, req *pb.SaveCertificateRequest) (*pb.SaveCertificateResponse, error)
SaveCertificate implements grpc api.
func (*Service) SaveConnection ¶
func (s *Service) SaveConnection(ctx context.Context, req *pb.SaveConnectionRequest) (*pb.SaveConnectionResponse, error)
SaveConnection implements grpc api.
func (*Service) StreamRecords ¶
func (s *Service) StreamRecords(stream pb.Archive_StreamRecordsServer) error
StreamRecords 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.