service

package
v0.0.0-...-740c552 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyStopped = errors.New("already stopped")

Functions

This section is empty.

Types

type Config

type Config interface {
	Check() error
	LogConfig() oplog.CLIConfig
	MetricsConfig() opmetrics.CLIConfig
	PprofConfig() oppprof.CLIConfig
	RPCConfig() oprpc.CLIConfig
}

func NewConfig

func NewConfig(ctx *cli.Context) Config

type Driver

type Driver interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

type Metricer

type Metricer interface {
	opmetrics.RegistryMetricer
	RecordInfo(version string)
	RecordUp()
}

type Service

type Service interface {
	cliapp.Lifecycle
	Kill() error
	WithDriver(driver Driver) Service
	WithMetrics(metrics Metricer) Service
	WithRPC(rpc rpc.API) Service
	WithRPCs(rpcs []rpc.API) Service
}

func NewService

func NewService(version string, cfg Config, log log.Logger) Service

Jump to

Keyboard shortcuts

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