Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientConn ¶
func ClientConn(cfg ClientCfg) (conn *grpc.ClientConn, err error)
ClientConn opens client connection with given configuration.
func PrepareServe ¶
PrepareServe builds gRPC server that allows graceful shutdown. You must start it by yourself with Serve() that blocks which typically means that you need a goroutine for that.
func Serve ¶
func Serve(cfg *ServerCfg)
Serve builds up the gRPC server and starts to serve. Note that the function blocks. In most cases you should start it as goroutine. To be able to gracefully stop the gRPC server you should call PrepareServe which builds everything ready but leaves calling the grpcServer.Serve for you.
Types ¶
type ClientCfg ¶
type ClientCfg struct { *PKI JWT string Addr string Opts []grpc.DialOption // Client should set the insecure flag if token should be sent // over insecure connection - intended for internal, secure networks only Insecure bool }
ClientCfg is gRPC client initialization and configuration struct.
func (ClientCfg) GetRequestMetadata ¶ added in v0.1.41
func (ClientCfg) RequireTransportSecurity ¶ added in v0.1.41
type PKI ¶
PKI is helper struct to keep need certification files for both S/C.