config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const S3_TIME_FORMAT = "20060102150405"

Variables

View Source
var ErrUnsupportedConfigFile = errors.New("unsupported config file")

Functions

func LoadConfiguration

func LoadConfiguration(path string) (map[string]Task, error)

Types

type Destination

type Destination struct {
	Type DestinationType         `json:"type" toml:"type"`
	S3   S3DestinationDefinition `json:"s3" toml:"s3"`
}

type DestinationType

type DestinationType string
const (
	S3Destination DestinationType = "s3"
)

type S3Credentials

type S3Credentials struct {
	AccessKeyId     string `json:"access_key_id" toml:"access_key_id"`
	SecretAccessKey string `json:"secret_access_key" toml:"secret_access_key"`
	SessionToken    string `json:"session_token,omitempty" toml:"session_token,omitempty"`
}

type S3DestinationDefinition

type S3DestinationDefinition struct {
	Bucket      string         `json:"bucket" toml:"bucket"`
	Prefix      string         `json:"prefix" toml:"prefix"`
	Suffix      string         `json:"suffix" toml:"suffix"`
	Region      string         `json:"region" toml:"region"`
	Credentials *S3Credentials `json:"credentials" toml:"credentials"`
	Profile     *string        `json:"profile" toml:"profile"`
}

func (S3DestinationDefinition) Client

func (d S3DestinationDefinition) Client() *s3.S3

func (S3DestinationDefinition) Key

func (d S3DestinationDefinition) Key(timestamp time.Time) string

func (S3DestinationDefinition) ParseTimestamp

func (d S3DestinationDefinition) ParseTimestamp(key string) (time.Time, error)

type Task

type Task struct {
	Schedule    utils.ScheduleExpression `json:"schedule" toml:"schedule"`
	Command     []string                 `json:"command" toml:"command"`
	Cwd         string                   `json:"cwd" toml:"cwd"`
	Env         []string                 `json:"env" toml:"env"`
	Timeout     string                   `json:"timeout" toml:"timeout"`
	Destination Destination              `json:"destination" toml:"destination"`
}

Jump to

Keyboard shortcuts

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