service

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package service provides an a wrapper for connection information and a small wrapper around the grpc server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClientConnection

func CreateClientConnection(info *ConnectionInfo) (*grpc.ClientConn, error)

CreateClientConnection creates a connection to a remote services with the given connection information

Types

type ConnectionInfo

type ConnectionInfo struct {
	Address string
	Port    int
}

ConnectionInfo contains all information required for connecting to a services

func NewConnectionInfo

func NewConnectionInfo(address string, port int) *ConnectionInfo

NewConnectionInfo creates new connection information struct

type GRPCServer

type GRPCServer struct {
	Server *grpc.Server
	Conn   *ConnectionInfo
	// contains filtered or unexported fields
}

GRPCServer represents the gRPC server and listener

func NewGRPCServer

func NewGRPCServer(info *ConnectionInfo) (*GRPCServer, error)

NewGRPCServer creates new gGRP server based on connection information

func (*GRPCServer) Serve

func (s *GRPCServer) Serve() error

Serve starts listening for incoming requests

Jump to

Keyboard shortcuts

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