grpcservice

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2017 License: MIT Imports: 12 Imported by: 6

Documentation

Index

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

func (*GRPCServer) Stop

func (grpcserver *GRPCServer) Stop() error

Stop the grpc server

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) Serve

func (g *GRPCService) Serve() error

Serve the service

func (*GRPCService) Setup

func (g *GRPCService) Setup(serverName string, grpcServer *GRPCServer,
	serverLogger *server.Logger, stopChan chan bool) error

Setup the service

func (*GRPCService) Stop

func (g *GRPCService) Stop() error

Stop 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

func (*GRPCWebServer) Stop

func (grpcserver *GRPCWebServer) Stop() error

Stop the 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) Serve

func (g *GRPCWebService) Serve() error

Serve the service

func (*GRPCWebService) Setup

func (g *GRPCWebService) Setup(serverName string, grpcServer *GRPCWebServer,
	serverLogger *server.Logger, stopChan chan bool) error

Setup the service

func (*GRPCWebService) Stop

func (g *GRPCWebService) Stop() error

Stop the service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL