config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceGit = "git"
	SourceDir = "dir"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

type BoltDB struct {
	Dir  string `toml:"dir" validate:"required"`
	Name string `toml:"filename"`
}

func (*BoltDB) Validate

func (config *BoltDB) Validate() bool

type Bucket

type Bucket struct {
	// Name string
	Source string `toml:"source" validate:"required,oneof=dir git"`

	LocalDir string `toml:"local_dir" validate:"required"`

	GitRepoUrl        string `toml:"git_repo_url" `
	GitRelativeDir    string `toml:"git_relative_dir"  validate:"required" default:"."`
	GitUsername       string `toml:"git_username" `
	GitPasswordEnvVar string `toml:"git_password_env_var" default:"CONFKV_GIT_PASSWORD"`
}

type Config

type Config struct {
	DB      BoltDB            `toml:"db" validate:"required"`
	Buckets map[string]Bucket `toml:"bucket" validate:"required,dive"`

	Cron Scheduler `toml:"scheduler" validate:"required"`
}

func MustOpen

func MustOpen(filename string) *Config

func (*Config) Validate

func (config *Config) Validate() bool

type Scheduler

type Scheduler struct {
	CronTab string `toml:"cron_tab" validate:"required" default:"0 * * * *"`
}

Jump to

Keyboard shortcuts

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