grpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

func (*Address) AsColonSeparatedString

func (addr *Address) AsColonSeparatedString() string

type Config

type Config struct {
	ServerConfig Server   `json:"server"`
	ServicesMap  Services `json:"services"`
	ZLogger      zerolog.Logger
}

func (*Config) ValidatePins

func (gc *Config) ValidatePins() error

type Endpoint

type Endpoint struct {
	Attributes []string `json:"attributes"`
	Address
}

type Router

type Router interface {
	StartServer(registrar func(grpc.ServiceRegistrar)) error
	StartServerAsync(registrar func(grpc.ServiceRegistrar)) (StopServer, error)
	GetConnection(serviceName string) (grpc.ClientConnInterface, error)
	io.Closer
}

func NewRouter

func NewRouter(config Config, logger zerolog.Logger) Router

type Server

type Server struct {
	Endpoint
	Workers int `json:"workers"`
}

type Service

type Service struct {
	Endpoints    map[string]Endpoint `json:"endpoints"`
	ServiceClass string              `json:"service-class"`
	Strategy     `json:"strategy"`
}

type Services

type Services map[string]Service

type StopServer

type StopServer func()

type Strategy

type Strategy struct {
	Endpoints []string `json:"endpoints"`
	Name      string   `json:"name"`
}

Jump to

Keyboard shortcuts

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