service

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// Name of service, must be unique.
	Name string `cfg:"name"`
	// Path of service, command run inside this path.
	Path string `cfg:"path"`
	// Command is the command to run with args, gotemplate enabled.
	Command string `cfg:"command"`
	// Env GoTemplate and Sprig functions are available.
	Env map[string]interface{} `cfg:"env"`
	// EnvValues is a list of environment variables path from exported config.
	EnvValues []string `cfg:"env_values"`
	// Inherit environment variables, default is false.
	InheritEnv bool `cfg:"inherit_env"`
	// User is the user to run command, id:group or just id.
	User string `cfg:"user"`
	// Filters is a function to filter stdout.
	Filters [][]byte `cfg:"filters"`
	// FiltersValues is a list of filter variables path from exported config.
	FiltersValues []string `cfg:"filters_values"`

	// Order is the order of service to run.
	//
	// If same order set, they will run in parallel.
	Order int `cfg:"order"`
	// Depends is a list of service names to depend on.
	//
	// Order is ignoring if depend is set.
	Depends []string `cfg:"depends"`
	// AllowFailure is a flag to allow failure of service.
	AllowFailure bool `cfg:"allow_failure"`
	// contains filtered or unexported fields
}

func (*Service) GetEnv

func (s *Service) GetEnv(predefined map[string]interface{}, environ bool, envPaths []string) ([]string, error)

func (*Service) Register

func (s *Service) Register() error

func (*Service) SetFilters

func (s *Service) SetFilters()

type Services

type Services []Service

func (Services) Run

func (s Services) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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