svcf

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 5 Imported by: 0

README

svcf

Adds go-flags support to voi-svc

Uppdates https://github.com/voi-oss/svc

with an pre-init-stage that parses github.com/jessevdk/go-flags

Also add a nullworker which can be embedded in service which only want the init-stage (blocks until terminated.)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SVC

type SVC struct {
	*svc.SVC
	// contains filtered or unexported fields
}

func New

func New(s *svc.SVC, options ...SVCFOption) *SVC

func (*SVC) AddFlagGroup added in v1.0.4

func (s *SVC) AddFlagGroup(name string, fg interface{})

AddFlagGroup adds a flag group to the service without it requiring to be a worker. useful to get consistent flag parsing for multiple modules.

func (*SVC) AddWorker

func (s *SVC) AddWorker(name string, w svc.Worker)

Adds a worker which also gets flags parsing for config management through github.com/jessevdk/go-flags

func (*SVC) Run

func (s *SVC) Run()

Run runs the service until either receiving an interrupt or a worker terminates.

type SVCFOption added in v1.3.0

type SVCFOption func(s *SVC)

func WithFlagHelpOut added in v1.3.0

func WithFlagHelpOut(w io.Writer) SVCFOption

direct flag based help messages to this writer.

func WithNoFlagHelp added in v1.3.0

func WithNoFlagHelp() SVCFOption

stops printing flag help on startup.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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