runner

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigBase

type ConfigBase interface {
	Load(string) error
}

ConfigBase is a interface used by Service

type Service

type Service interface {
	New() Service
	ConfigBase() ConfigBase
	StartGRPC(registrar grpc.ServiceRegistrar) error
	Close()
}

Service is a interface

type ServiceRunner

type ServiceRunner struct {
	// contains filtered or unexported fields
}

ServiceRunner allow you run grpc service all-in-one

func New

New create a ServiceRunner

func (*ServiceRunner) AddService

func (s *ServiceRunner) AddService(serviceUnits ...ServiceUnit) error

AddService start a grpc server on addr, and registe all serviceUints

func (*ServiceRunner) Close

func (s *ServiceRunner) Close()

Close close all services

type ServiceUnit

type ServiceUnit struct {
	Service    Service
	ConfigFile string
}

ServiceUnit contain a service and it's config file path

Jump to

Keyboard shortcuts

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