Documentation
¶
Overview ¶
Package grpcrestserver serves the grpc and grpc-gateway rest handlers. This server extracts out all the boilerpalte code of creating a grpc/grpc-gateway server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthHelperFuncs ¶
type AuthHelperFuncs struct { VerifyCredentialsFunc loginservice.VerifyCredentialsFunc GenerateTokenFunc loginservice.GenerateTokenFunc ParseTokenFunc loginservice.ParseTokenFunc }
AuthHelperFuncs will be used by login service to verify credentials, generate a token, and parse the token.
type GRPCHandlerCallback ¶
GRPCHandlerCallback is a callback which will be called while it is creating GRPC server, this handler must be responsible for initializing the service implementations.
type Options ¶
type Options struct { // GRPC server address eg. localhost:8889 GRPCServerAddr string // REST server address eg. localhost:8888 RESTServerAddr string // GRPC service handler callbacks GRPCServiceHandlers []GRPCHandlerCallback // REST endpoing handler callbacks RESTEndpointHandlers []RESTHandlerCallback // TLSOptions TLSOptions TLSOptions // AuthHelperFuncs which are used for login, authenticating each request. // These handlers are used at GRPC level. If you are fine using the default handlers for these keep it uninitialized. // Refer: loginservice.DefaultVerifyCredentialsFunc, loginservice.DefaultGenerateTokenFunc, loginservice.DefaultParseTokenFunc. AuthHelperFuncs AuthHelperFuncs // Swagger json file paths SwaggerJsonFilePaths []string }
Options to start the both grpc server and grpc-gateway server.
type RESTHandlerCallback ¶
RESTHandlerCallback is a callback which will be called while it is creating REST server, this handler must be responsible for initializing the service implementations.
type TLSOptions ¶
type TLSOptions struct { // Path to Certificate file CertFilePath string // Path to the Key file KeyFilePath string }
TLSOptions to connect securely between grpc server and grpc gateway.