Documentation ¶
Index ¶
- type ConnectionInfo
- type GRPCClient
- type GRPCServer
- type GRPCService
- type GRPCWebServer
- func (grpcserver GRPCWebServer) GetInnerInstance() *grpc.Server
- func (grpcserver GRPCWebServer) GetInstance() *grpcweb.WrappedGrpcServer
- func (grpcserver GRPCWebServer) IsInitialized() bool
- func (grpcserver GRPCWebServer) IsRunning() bool
- func (grpcserver *GRPCWebServer) Serve() error
- func (grpcserver *GRPCWebServer) Stop() error
- type GRPCWebService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionInfo ¶
type ConnectionInfo struct { UseTLS bool CertFile string ServerHostName string IP string Port string TimeoutInMilliSecs int RetryTimes int RetryAfterMilliSecs int }
ConnectionInfo describes the information necessary to connect to a grpc service
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
The GRPCClient is a struct defining all the contents needed to setup a connection to a grpc server.
func (GRPCClient) Close ¶
func (grpcclient GRPCClient) Close() error
Close the grpc client connection
func (*GRPCClient) Connect ¶
func (grpcclient *GRPCClient) Connect(info *ConnectionInfo) error
Connect initializes a connection with a grpc server to use by a client.
func (GRPCClient) GetConnection ¶
func (grpcclient GRPCClient) GetConnection() *grpc.ClientConn
GetConnection returns a pointer to the connection instance
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
The GRPCServer is a struct defining all the contents needed to setup a grpc server.
func NewGRPCServer ¶
func NewGRPCServer( useTLS bool, certFile string, keyFile string, port int) *GRPCServer
NewGRPCServer initializes the server struct offering a service
func (GRPCServer) GetInstance ¶
func (grpcserver GRPCServer) GetInstance() *grpc.Server
GetInstance returns a pointer to server instance
func (GRPCServer) IsInitialized ¶
func (grpcserver GRPCServer) IsInitialized() bool
IsInitialized indicates if the server was initialized properly
func (GRPCServer) IsRunning ¶
func (grpcserver GRPCServer) IsRunning() bool
IsRunning indicates if the server started listening properly
func (*GRPCServer) Serve ¶
func (grpcserver *GRPCServer) Serve() error
Serve registers the server as grpc server and starts it with the given listener
type GRPCService ¶
type GRPCService struct { Prefix string *GRPCServer *server.Logger // StopChannel is the channel the main waits for to quit the server execution StopChannel chan bool // contains filtered or unexported fields }
GRPCService defines anything necessary to setup, run and stop a general grpc server
func (*GRPCService) Setup ¶
func (g *GRPCService) Setup(serverName string, grpcServer *GRPCServer, serverLogger *server.Logger, stopChan chan bool) error
Setup the service
type GRPCWebServer ¶
type GRPCWebServer struct {
// contains filtered or unexported fields
}
The GRPCWebServer is a struct defining all the contents needed to setup a grpc server.
func NewGRPCWebServer ¶
func NewGRPCWebServer(useTLS bool, certFile string, keyFile string, port int) *GRPCWebServer
NewGRPCWebServer initializes a server struct offering a GRPCWeb Web service
func (GRPCWebServer) GetInnerInstance ¶
func (grpcserver GRPCWebServer) GetInnerInstance() *grpc.Server
GetInnerInstance returns a pointer to server instance
func (GRPCWebServer) GetInstance ¶
func (grpcserver GRPCWebServer) GetInstance() *grpcweb.WrappedGrpcServer
GetInstance returns a pointer to server instance
func (GRPCWebServer) IsInitialized ¶
func (grpcserver GRPCWebServer) IsInitialized() bool
IsInitialized indicates if the server was initialized properly
func (GRPCWebServer) IsRunning ¶
func (grpcserver GRPCWebServer) IsRunning() bool
IsRunning indicates if the server started listening properly
func (*GRPCWebServer) Serve ¶
func (grpcserver *GRPCWebServer) Serve() error
Serve registers the server as grpc server
type GRPCWebService ¶
type GRPCWebService struct { Prefix string *GRPCWebServer *server.Logger // StopChannel is the channel the main waits for to quit the server execution StopChannel chan bool // contains filtered or unexported fields }
GRPCWebService defines anything necessary to setup, run and stop a general grpc server
func (*GRPCWebService) Setup ¶
func (g *GRPCWebService) Setup(serverName string, grpcServer *GRPCWebServer, serverLogger *server.Logger, stopChan chan bool) error
Setup the service