config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 5 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 {
	Source      SourceConfig      `json:"source"`
	Process     ProcessConfig     `json:"process"`
	Destination DestinationConfig `json:"destination"`
	DryRun      bool              `json:"dry_run"`
}

Config is the top-level configuration.

func Load

func Load(v *viper.Viper, configFile string) (*Config, error)

Load reads configuration from file and environment. Environment variables use the prefix SECRET_SHIFT_SRC_ for source fields and SECRET_SHIFT_DST_ for destination fields, e.g.:

SECRET_SHIFT_SRC_GITHUB_TOKEN=xxx
SECRET_SHIFT_DST_GITHUB_TOKEN=yyy

func (*Config) Validate

func (c *Config) Validate() error

Validate checks the configuration for correctness.

type DestinationConfig

type DestinationConfig struct {
	GitConfig
	VaultConfig
	EtcdConfig
	KubernetesConfig
	FileConfig

	Type             provider.Type `json:"type"`
	ConflictStrategy string        `json:"conflict_strategy"`
	ProjectID        string        `json:"project_id"`
}

DestinationConfig holds the destination provider configuration.

type EtcdConfig

type EtcdConfig struct {
	EtcdEndpoints []string `json:"etcd_endpoints"`
	EtcdPrefix    string   `json:"etcd_prefix"`
	EtcdUsername  string   `json:"etcd_username"`
	EtcdPassword  string   `json:"etcd_password"`
}

EtcdConfig holds etcd-specific configuration.

type FileConfig

type FileConfig struct {
	Path       string `json:"path"`
	Format     string `json:"format"`
	Encrypt    bool   `json:"encrypt"`
	EncryptKey string `json:"encrypt_key"`
}

FileConfig holds file-specific configuration.

type GitConfig

type GitConfig struct {
	Repo     string `json:"repo"`
	TokenEnv string `json:"token_env"`
	Token    string `json:"token"`
	URL      string `json:"url"`
}

GitConfig holds GitHub/GitLab-specific configuration.

type KubernetesConfig

type KubernetesConfig struct {
	KubeNamespace  string `json:"kube_namespace"`
	KubeSecretName string `json:"kube_secret_name"`
	KubeConfig     string `json:"kube_config"`
	KubeLabel      string `json:"kube_label"`
}

KubernetesConfig holds Kubernetes-specific configuration.

type ProcessConfig

type ProcessConfig struct {
	AddPrefix    string   `json:"add_prefix"`
	AddSuffix    string   `json:"add_suffix"`
	IncludeRegex string   `json:"include_regex"`
	ExcludeRegex string   `json:"exclude_regex"`
	IncludeTypes []string `json:"include_types"`
	ExcludeTypes []string `json:"exclude_types"`
}

ProcessConfig holds the processing/filtering configuration.

type SourceConfig

type SourceConfig struct {
	GitConfig
	VaultConfig
	EtcdConfig
	KubernetesConfig
	FileConfig

	Type      provider.Type `json:"type"`
	ProjectID string        `json:"project_id"`
}

SourceConfig holds the source provider configuration.

type VaultConfig

type VaultConfig struct {
	VaultAddress string `json:"vault_address"`
	VaultPath    string `json:"vault_path"`
	VaultMount   string `json:"vault_mount"`
}

VaultConfig holds Vault-specific configuration.

Jump to

Keyboard shortcuts

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