service

package module
v2.17.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 15 Imported by: 1

README

Documentation

Index

Constants

View Source
const PluginName string = "service"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Services map[string]*Service `mapstructure:"service"`
}

Config for the services

func (*Config) InitDefault

func (c *Config) InitDefault()

type Env

type Env map[string]string

Env variables type alias

type Plugin

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

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger) error

func (*Plugin) Name

func (p *Plugin) Name() string

Name contains service name.

func (*Plugin) RPC added in v2.10.0

func (p *Plugin) RPC() interface{}

func (*Plugin) Reset added in v2.13.0

func (p *Plugin) Reset() error

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

func (*Plugin) Workers

func (p *Plugin) Workers() []*process.State

type Process

type Process struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Process structure contains an information about process, restart information, log, errors, etc

func NewServiceProcess

func NewServiceProcess(service *Service, l *zap.Logger) *Process

NewServiceProcess constructs service process structure

func (*Process) Write

func (p *Process) Write(b []byte) (int, error)

write message to the log (stderr)

type Service

type Service struct {
	Command         string        `mapstructure:"command"`
	ProcessNum      int           `mapstructure:"process_num"`
	ExecTimeout     time.Duration `mapstructure:"exec_timeout"`
	RemainAfterExit bool          `mapstructure:"remain_after_exit"`
	RestartSec      uint64        `mapstructure:"restart_sec"`
	Env             Env           `mapstructure:"env"`
}

Service represents particular service configuration

Jump to

Keyboard shortcuts

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