config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskTypeExec    = "exec"
	TaskTypeBuiltIn = "builtin"
)

Variables

View Source
var ValidTaskTypes = []string{
	TaskTypeExec,
	TaskTypeBuiltIn,
}

Functions

This section is empty.

Types

type Action

type Action func(args *args.Args, logger *logger.Logger) error

type Config

type Config struct {
	Tasks   []Task             `json:"tasks"`
	User    User               `json:"user"`
	PassBin string             `json:"passBin"`
	Storage map[string]Storage `json:"storage"`
	Ping    Ping               `json:"ping"`
	Notify  Notify             `json:"notify"`
	Mail    Mail               `json:"mail"`
	Filters []string           `json:"filters"`
}

func Get

func Get(path string) (config Config, err error)

func (Config) GetRunnableTasks

func (self Config) GetRunnableTasks(slugs []string) []Task

type Mail

type Mail struct {
	Enabled bool   `json:"enabled"`
	Type    string `json:"type"`
}

type Notify

type Notify struct {
	Enabled bool `json:"enabled"`
}

type Ping

type Ping struct {
	Enabled  bool   `json:"enabled"`
	Endpoint string `json:"endpoint"`
}

func (Ping) GetEndpoint

func (self Ping) GetEndpoint() (string, error)

type Storage

type Storage struct {
	Path   string `json:"path"`
	Commit bool   `json:"commit"`
	Chown  bool   `json:"chown"`
}

type Task

type Task struct {
	Slug       string `json:"slug"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Scheduled  bool   `json:"scheduled"`
	Post       bool   `json:"post"`
	EntryPoint string `json:"entrypoint"`
}

func (Task) GetBuiltInAction

func (self Task) GetBuiltInAction() Action

func (Task) GetDisplayEnabled

func (self Task) GetDisplayEnabled() string

func (Task) GetLongString

func (self Task) GetLongString() string

func (Task) GetShortString

func (self Task) GetShortString() string

type User

type User struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

Jump to

Keyboard shortcuts

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