Documentation
¶
Index ¶
- func NewCertPool(ca string) (*x509.CertPool, error)
- func NewClientTransportCreds(ca, crt, key string) (credentials.TransportCredentials, error)
- func NewServerTransportCreds(ca, crt, key string) (credentials.TransportCredentials, error)
- func NewTLSConfig(crt, key string) (*tls.Config, error)
- func StreamInterceptor(service_id string) grpc.StreamServerInterceptor
- func UnaryInterceptor(service_id string) grpc.UnaryServerInterceptor
- type Server
- type ServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCertPool ¶
NewCertPool takes the path of a CA cert and attempts to parse the certificate, adding it to a CA pool if successful.
func NewClientTransportCreds ¶
func NewClientTransportCreds(ca, crt, key string) (credentials.TransportCredentials, error)
NewClientTransportCreds creates gRPC Transport Credentials with a root CA configured.
func NewServerTransportCreds ¶
func NewServerTransportCreds(ca, crt, key string) (credentials.TransportCredentials, error)
NewServerTransportCreds creates gRPC Transport Credentials with a client CA configured.
func NewTLSConfig ¶
NewTLSConfig takes the paths of a server cert/key and returns TLS transport credentials. TLS 1.3 is the minimum version.
func StreamInterceptor ¶
func StreamInterceptor(service_id string) grpc.StreamServerInterceptor
StreamInterceptor instruments and logs information about gRPC stream calls.
func UnaryInterceptor ¶
func UnaryInterceptor(service_id string) grpc.UnaryServerInterceptor
UnaryInterceptor instruments and logs information about gRPC unary calls.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a wrapper around a *grpc.Server. It provides helper functions for starting the server and registering services.
func NewServer ¶
func NewServer(opts []grpc.ServerOption) *Server
func (*Server) RegisterService ¶
func (s *Server) RegisterService(sd *grpc.ServiceDesc, svc interface{})
RegisterService registers a gRPC service to the underlying server.