config

package
v0.0.0-...-f3ec421 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	On     string   `yaml:"on" env-default:"push" json:"on,omitempty"`
	Branch string   `yaml:"branch" env-default:"master" json:"branch,omitempty"`
	Cwd    string   `yaml:"cwd" json:"cwd,omitempty"`
	User   string   `yaml:"user" json:"user,omitempty"`
	Script string   `yaml:"script" json:"script,omitempty"`
	Run    []string `yaml:"run" json:"run,omitempty"`
}

type Config

type Config struct {
	Host          string             `yaml:"host" env:"HOST" env-default:"localhost"`
	Port          int16              `yaml:"port" env:"PORT" env-default:"9090"`
	PublicUrl     string             `yaml:"public_url" env:"PUBLIC_URL"`
	DisableApi    bool               `yaml:"disable_api" env:"DISABLE_API"`
	ApiUser       string             `yaml:"api_user" env:"API_USER" env-default:"admin"`
	ApiPassword   string             `yaml:"api_password" env:"API_PASSWORD"`
	LogLevel      string             `yaml:"log_level" env:"LOG_LEVEL" env-default:"info"`
	LogsDbFile    string             `yaml:"logs_db_file" env:"LOGS_DB_FILE" env-default:"logs.sqlite3"`
	ActionsDbFile string             `yaml:"actions_db_file" env:"ACTIONS_DB_FILE" env-default:"actions.sqlite3"`
	Ssl           SslConfig          `yaml:"ssl" env-prefix:"SSL__"`
	Projects      map[string]Project `yaml:"projects" env-required:"true"`
}

func Load

func Load(configPath string) (Config, error)

func (Config) MaskSensitiveData

func (cfg Config) MaskSensitiveData() Config

type Project

type Project struct {
	GitProvider   string   `yaml:"git_provider" env-default:"github"`
	Repo          string   `yaml:"repo" env-required:"true"`
	Authorization string   `yaml:"authorization" env:"AUTH"`
	Secret        string   `yaml:"secret" env:"SECRET"`
	Actions       []Action `yaml:"actions" env-required:"true"`
}

func (Project) MaskSensitiveData

func (prj Project) MaskSensitiveData() Project

type SslConfig

type SslConfig struct {
	CertFilePath string `yaml:"cert_file_path" env:"CERT_FILE_PATH"`
	KeyFilePath  string `yaml:"key_file_path" env:"KEY_FILE_PATH"`
}

type StructEnvFields

type StructEnvFields struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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