commandline

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterruptGroup

func InterruptGroup(pgid int, service *services.ServiceConfig) error

InterruptGroup sends an interrupt signal to a process group. Will use sudo if required by this service.

func KillGroup

func KillGroup(pgid int, service *services.ServiceConfig) error

KillGroup sends a kill signal to a process group. Will use sudo priviledges if required by this service.

Types

type Backend

type Backend struct {
	// Commands for managing the service
	Commands ServiceConfigCommands `json:"commands"`

	// Checks to perform to ensure that a service has started correctly
	LaunchChecks *LaunchChecks `json:"launch_checks,omitempty"`
}

func GetConfigCommandLine

func GetConfigCommandLine(s *services.ServiceConfig) (*Backend, error)

func (*Backend) HasBuildStep

func (c *Backend) HasBuildStep() bool

func (*Backend) HasLaunchStep

func (c *Backend) HasLaunchStep() bool

func (*Backend) Name

func (c *Backend) Name() string

func (*Backend) UnmarshalJSON

func (c *Backend) UnmarshalJSON(data []byte) error

type LaunchChecks

type LaunchChecks struct {
	// A string to look for in the service's logs that indicates it has completed startup.
	LogText string `json:"log_text,omitempty"`
	// One or more specific ports that are expected to be opened when this service starts.
	Ports []int `json:"ports,omitempty"`
	// Wait for a specified amount of time (in ms) before calling the service started if still running.
	Wait int64 `json:"wait,omitempty"`
}

LaunchChecks defines the mechanism for testing whether a service has started successfully

type LegacyUnmarshaler

type LegacyUnmarshaler struct{}

func (*LegacyUnmarshaler) Unmarshal

func (l *LegacyUnmarshaler) Unmarshal(data []byte, c *services.ServiceConfig) error

type Loader

type Loader struct {
}

func (*Loader) Builder

func (*Loader) Handles

func (l *Loader) Handles(c services.Backend) bool

func (*Loader) Name

func (l *Loader) Name() string

func (*Loader) New

func (l *Loader) New() services.Backend

func (*Loader) Runner

type ServiceConfigCommands

type ServiceConfigCommands struct {
	// Command to build
	Build string `json:"build,omitempty"`
	// Command to launch
	Launch string `json:"launch,omitempty"`
	// Optional command to stop
	Stop string `json:"stop,omitempty"`
}

ServiceConfigCommands define the commands for building, launching and stopping a service All commands are optional

type ServiceConfigProperties

type ServiceConfigProperties struct {
	// Regex to detect a line indicating the service has started successfully
	Started string `json:"started,omitempty"`
	// Custom properties, mapping a property name to a regex
	Custom map[string]string `json:"-"`
}

ServiceConfigProperties provides a set of regexes to detect properties of a service Deprecated: This has been dropped in favour of LaunchChecks

Jump to

Keyboard shortcuts

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