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: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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