conf

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCaddyImport added in v0.0.12

func MakeCaddyImport(c *Config) []byte

func ParseCommand added in v0.0.31

func ParseCommand(s string) (machine, name, command string, err error)

ParseCommand parses a pgoctl command line: pgoctl localhost:caddy//exec /bin/ls -l / machine: localhost name: caddy command: exec args: rest

func Stale added in v0.0.30

func Stale(sx []*Service, dir string) error

Stale checks the directory for service subdirs and substracts the current service from it, and then downs the compose service and then removes the directory (recursively). a slice of stale services that can be downed and removed.

func Track

func Track(ctx context.Context, file string, done chan<- os.Signal)

Track will sha1 sum the contents of file and if it differs from previous runs, will SIGHUP ourselves so we exist with status code 2, which in turn will systemd restart us again.

Types

type Config

type Config struct {
	Services []*Service
}

func Parse

func Parse(doc []byte) (*Config, error)

type Service

type Service struct {
	Name        string
	User        string
	Repository  string
	Registries  []string // user:token@registry auth
	ComposeFile string   `toml:"compose,omitempty"` // alternative compose file
	Branch      string
	Import      string            // filename of caddy file to generate
	Reload      string            // reload command to use for caddy
	Mount       string            // Optional (NFS) mount
	URLs        map[string]string // url -> host:port
	Env         []string
	Networks    []string
	Git         *git.Git         `toml:"-"`
	Compose     *compose.Compose `toml:"-"`
	// contains filtered or unexported fields
}

func (*Service) InitGitAndCompose

func (s *Service) InitGitAndCompose(dir, datadir string) error

func (*Service) IsForcedDown added in v0.0.35

func (s *Service) IsForcedDown() bool

Is a <pgodir>/service.stop exists down the service and complain. TODO(miek): read the file's contents for state?

func (*Service) MountStorage added in v0.0.42

func (s *Service) MountStorage() error

func (*Service) PublicKeys

func (s *Service) PublicKeys() ([]ssh.PublicKey, error)

PublicKeys parses the public keys in the ssh/ directory of the repository.

func (*Service) Track

func (s *Service) Track(ctx context.Context, duration time.Duration)

Jump to

Keyboard shortcuts

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