grpc

package
v0.0.0-...-5bbb7b8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ClientConn() *grpc.ClientConn
	HealthCheck() *Status
}

Client is the generic client to a gRPC service.

func NewClient

func NewClient(config *ClientConfig, name string, url string) Client

NewClient establishes a client connection to a gRPC service.

type ClientConfig

type ClientConfig struct {
	credentials.TransportCredentials
}

ClientConfig defines the interface for the environment of a service's connection as a client to other services.

func NewClientConfig

func NewClientConfig(tlsCert string) *ClientConfig

NewClientConfig generates a new service client environment.

type Server

type Server struct {
	*service.ServerConfig
	net.Listener
	MongoClient mongo.Client
	// contains filtered or unexported fields
}

Server defines the structure of the server for a gRPC service.

func NewServer

func NewServer(config *service.ServerConfig, srv Service) *Server

NewServer creates a new listener and gRPC server for a gRPC service.

func (*Server) StartServer

func (s *Server) StartServer()

StartServer provides the callback function to start the server.

type Service

type Service interface {
	service.Server
	RegisterServer(srv *grpc.Server)
}

Service defines the interface of a server for a gRPC service.

type Status

type Status struct {
	Result bool
	Error  error
}

Status represents the response to a gRPC health check.

Jump to

Keyboard shortcuts

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