Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertError ¶
ConvertError checks whether err is a gRPC error representing a common go error. If so, returns the go error, otherwise returns err.
func NewClientTLS ¶
func NewClientTLS(crt []byte) credentials.TransportCredentials
NewClientTLS constructs TLS credentials from the input certificate for client. That is, crt is the contents of the *.crt file. Note that this will attempt to start with the system cert pool if possible.
func NewServerTLS ¶
func NewServerTLS(crt []byte, key []byte) (credentials.TransportCredentials, error)
NewServerTLS constructs TLS credentials from the input certificate and key for server. That is, crt is the contents of the *.crt file, and key is the contents of the *.key file.
Types ¶
type Server ¶
type Server interface {
// Serve accepts incoming connections on the listener lis. Serve returns
// when lis.Accept fails with fatal errors. lis will be closed on return.
// Serve will return a non-nil error unless Stop or GracefulStop is called.
Serve(lis net.Listener) error
// Stop stops the server. It immediately closes all open connections and
// listeners.
Stop()
// GracefulStop stops the server gracefully. It stops the server from
// accepting new connections and blocks until all pending tasks are
// finished.
GracefulStop()
}
Server is the interface that a gRPC server exposes to the public.
Click to show internal directories.
Click to hide internal directories.