config

package
v0.0.0-...-dde1a55 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Jobs []Job `yaml:"jobs"`
}

func LoadConfigFile

func LoadConfigFile(filename string) (*Config, error)

type Decryption

type Decryption struct {
	Password string `yaml:"password"`
}

type Expect

type Expect struct {
	Code int    `yaml:"code" default:"200"`
	Body string `yaml:"body"`
}

type File

type File struct {
	Path        string      `yaml:"path"`
	Permissions Permissions `yaml:"permissions"`
}

type HTTPResource

type HTTPResource struct {
	URL         string              `yaml:"url"`
	Method      string              `yaml:"method"`
	Headers     map[string][]string `yaml:"headers"`
	Expect      Expect              `yaml:"expect"`
	Timeout     time.Duration       `yaml:"timeout"`
	MaxAttempts int                 `yaml:"max_attempts" default:"3"`
	Body        string              `yaml:"body"`
}

type Job

type Job struct {
	Name     string   `yaml:"name"`
	Schedule Schedule `yaml:"schedule"`
	Resource Resource `yaml:"resource"`
	File     File     `yaml:"file"`
	Trigger  Trigger  `yaml:"trigger"`
}

type Permissions

type Permissions struct {
	Mode  string `yaml:"mode" default:"0644"`
	Owner string `yaml:"owner" default:"root"`
	Group string `yaml:"group" default:"root"`
}

type Resource

type Resource struct {
	Type       string        `yaml:"type"`
	Decryption Decryption    `yaml:"decryption"`
	HTTP       *HTTPResource `yaml:"http"`
	S3         *S3Resource   `yaml:"s3"`
}

type S3Resource

type S3Resource struct {
	Endpoint        string `yaml:"endpoint"`
	AccessKeyID     string `yaml:"access_key_id"`
	SecretAccessKey string `yaml:"secret_access_key"`
	Bucket          string `yaml:"bucket"`
	Region          string `yaml:"region"`
	SSL             bool   `yaml:"ssl" default:"true"`
	Object          string `yaml:"object"`
}

type Schedule

type Schedule struct {
	Expression string `yaml:"expression"`
	Timezone   string `yaml:"timezone" default:"Local"`
	Jitter     int    `yaml:"jitter" default:"5"`
}

type Trigger

type Trigger struct {
	Command []string `yaml:"command"`
	User    string   `yaml:"user" default:"root"`
	Group   string   `yaml:"group" default:"root"`
	CWD     string   `yaml:"cwd"`
}

Jump to

Keyboard shortcuts

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