Documentation ¶
Overview ¶
Package notary implements a tlsutil.Notary 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) DownloadCerts(ctx context.Context, chain string) ([]*x509.Certificate, error)
- func (c *Client) GetServerChain(ctx context.Context, ip net.IP, port int, sni, profile string) (string, error)
- func (c *Client) Ping() error
- func (c *Client) SetServerChain(ctx context.Context, ip net.IP, port int, sni, profile string, chain string) error
- func (c *Client) UploadCerts(ctx context.Context, certs []*x509.Certificate) (string, error)
- func (c *Client) VerifyChain(ctx context.Context, chain string, dnsname string, force bool) (tlsutil.VerifyResponse, error)
- type ClientOption
- type Service
- func (s *Service) DownloadCerts(ctx context.Context, in *pb.DownloadCertsRequest) (*pb.DownloadCertsResponse, error)
- func (s *Service) GetServerChain(ctx context.Context, in *pb.GetServerChainRequest) (*pb.GetServerChainResponse, error)
- func (s *Service) SetServerChain(ctx context.Context, in *pb.SetServerChainRequest) (*pb.SetServerChainResponse, error)
- func (s *Service) UploadCerts(ctx context.Context, in *pb.UploadCertsRequest) (*pb.UploadCertsResponse, error)
- func (s *Service) VerifyChain(ctx context.Context, in *pb.VerifyChainRequest) (*pb.VerifyChainResponse, error)
- type ServiceOption
Constants ¶
const ( APIName = "luids.tlsutil" APIVersion = "v1" APIService = "Notary" )
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 client.
func (*Client) DownloadCerts ¶
DownloadCerts implements tlsutil.Notary interface.
func (*Client) GetServerChain ¶
func (c *Client) GetServerChain(ctx context.Context, ip net.IP, port int, sni, profile string) (string, error)
GetServerChain implements tlsutil.Notary interface.
func (*Client) SetServerChain ¶
func (c *Client) SetServerChain(ctx context.Context, ip net.IP, port int, sni, profile string, chain string) error
SetServerChain implements tlsutil.Notary interface.
func (*Client) UploadCerts ¶
UploadCerts implements tlsutil.Notary 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 close.
func SetCache ¶
func SetCache(ttl, negativettl int) ClientOption
SetCache sets cache ttl and negative ttl (for validations).
func SetCacheCleanUps ¶
func SetCacheCleanUps(d time.Duration) ClientOption
SetCacheCleanUps sets interval between cache cleanups.
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(notary tlsutil.Notary, opt ...ServiceOption) *Service
NewService returns a new Service.
func (*Service) DownloadCerts ¶
func (s *Service) DownloadCerts(ctx context.Context, in *pb.DownloadCertsRequest) (*pb.DownloadCertsResponse, error)
DownloadCerts implements grpc api.
func (*Service) GetServerChain ¶
func (s *Service) GetServerChain(ctx context.Context, in *pb.GetServerChainRequest) (*pb.GetServerChainResponse, error)
GetServerChain implements grpc api.
func (*Service) SetServerChain ¶
func (s *Service) SetServerChain(ctx context.Context, in *pb.SetServerChainRequest) (*pb.SetServerChainResponse, error)
SetServerChain implements grpc api.
func (*Service) UploadCerts ¶
func (s *Service) UploadCerts(ctx context.Context, in *pb.UploadCertsRequest) (*pb.UploadCertsResponse, error)
UploadCerts implements grpc api.
func (*Service) VerifyChain ¶
func (s *Service) VerifyChain(ctx context.Context, in *pb.VerifyChainRequest) (*pb.VerifyChainResponse, error)
VerifyChain 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.