config

package
v0.0.0-...-3a65d20 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDestinationNameList

func GetDestinationNameList(serviceName string, taskName string) []string

func GetLoadedAt

func GetLoadedAt() time.Time

func GetLocation

func GetLocation() *time.Location

func GetServiceNameList

func GetServiceNameList() []string

func GetTaskNameList

func GetTaskNameList(serviceName string) []string

func Load

func Load(pathname string) error

func SetCliConfig

func SetCliConfig(config *CliConfig)

func WatchConfigChanges

func WatchConfigChanges(ctx context.Context, cancel func())

func Yaml

func Yaml() string

Types

type API

type API struct {
	Users map[string]string `yaml:"users,omitempty"`
}

type CliConfig

type CliConfig struct {
	Tags []string
}

type Config

type Config struct {
	TimeZone string `yaml:"timezone,omitempty"`

	Services    map[string]Service `yaml:"services"`
	Tags        []string           `yaml:"tags,omitempty"`
	Secrets     Secrets            `yaml:"secrets,omitempty"`
	Extends     Extends            `yaml:"extends,omitempty"`
	Definitions Definitions        `yaml:"definitions,omitempty"`
	API         API                `yaml:"api,omitempty"`
	// contains filtered or unexported fields
}

func Get

func Get() Config

type Definitions

type Definitions struct {
	Destinations  map[string]DriverDestinationConfig  `yaml:"destinations,omitempty"`
	Notifications map[string]DriverNotificationConfig `yaml:"notifications,omitempty"`
}

type DriverDestinationConfig

type DriverDestinationConfig struct {
	Extends string               `yaml:"extends,omitempty"`
	Driver  dmanager.Destination `yaml:"driver,omitempty"`
	Config  interface{}          `yaml:"config,omitempty"`
	Env     map[string]string    `yaml:"env,omitempty"`
}

type DriverNotificationConfig

type DriverNotificationConfig struct {
	Driver dmanager.Notification `yaml:"driver,omitempty"`
	Config map[string]string     `yaml:"config,omitempty"`
	Events []sctxt.EventType     `yaml:"events,omitempty"`
}

func (*DriverNotificationConfig) IsAvailableEvent

func (notification *DriverNotificationConfig) IsAvailableEvent(event sctxt.EventType) bool

type DriverSourceConfig

type DriverSourceConfig struct {
	Driver dmanager.Source   `yaml:"driver,omitempty"`
	Config interface{}       `yaml:"config,omitempty"`
	Env    map[string]string `yaml:"env,omitempty"`
}

type Extends

type Extends struct {
	Secrets []string `yaml:"secrets,omitempty"`
	Configs []string `yaml:"configs,omitempty"`
}

type FileInfo

type FileInfo struct {
	Config Config

	ConfigPathname              string
	ExtendedConfigPathnameList  []string
	ExtendedSecretsPathnameList []string

	ExtendedFileInfoList []FileInfo
	ExtendedSecretsList  []Secrets
}

type FileLists

type FileLists struct {
	SecretsFileList        []string
	ExtendedConfigFileList []string
}

type OperationMode

type OperationMode string
const (
	OperationModeCopy       OperationMode = "copy"
	OperationModePreferPipe OperationMode = "prefer-pipe"
	OperationModePipe       OperationMode = "pipe"
)

type Schedule

type Schedule struct {
	Backup string `yaml:"backup,omitempty"`
	Prune  string `yaml:"prune,omitempty"`
}

type Secrets

type Secrets map[string]string

type Service

type Service map[string]Task

type Task

type Task struct {
	OperationMode OperationMode                      `yaml:"operationMode,omitempty"`
	Source        DriverSourceConfig                 `yaml:"source,omitempty"`
	Destinations  map[string]DriverDestinationConfig `yaml:"destinations,omitempty"`
	Notifications []string                           `yaml:"notifications,omitempty"`
	Schedule      Schedule                           `yaml:"schedule,omitempty"`
	Tags          []string                           `yaml:"tags,omitempty"`
}

type TaskConfig

type TaskConfig struct {
	Schedule      Schedule
	Source        DriverSourceConfig
	OperationMode OperationMode
	Destinations  map[string]DriverDestinationConfig
	Notifications map[string]DriverNotificationConfig
	Tags          []string
}

func GetConfigForTask

func GetConfigForTask(serviceName string, taskName string) (TaskConfig, error)

Jump to

Keyboard shortcuts

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