config

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 1 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 {
	Envs  map[string]Environment `mapstructure:"envs"`
	Paths []Path                 `mapstructure:"paths"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

type Destination

type Destination struct {
	// Output type (file, git)
	Type DestinationType `mapstructure:"type"`

	// For git type define output git repository
	Repo string `mapstructure:"repo"`

	// Root path of output. For git type relative to repo root
	Path string `mapstructure:"path"`

	// Do not delete any existing files in destination only template and update specified files
	UpsertMode bool `mapstructure:"upsert"`
}

type DestinationType added in v0.1.8

type DestinationType string
const (
	Git     DestinationType = "git"
	File    DestinationType = "file"
	Console DestinationType = "console"
)

type Environment

type Environment struct {
	// Provider to configure for this environment
	Provider ProviderType `mapstructure:"provider"`

	// Api key to pass to provider
	APIKey string `mapstructure:"apiKey"`

	// Environment variable to source the api key from instead of apiKey
	EnvKey string `mapstructure:"envKey"`
}

type Path

type Path struct {
	// File glob pattern to template
	Path string `mapstructure:"path"`

	// Environment to use for feature flag population
	Env string `mapstructure:"env"`

	// Output definition
	Destination Destination `mapstructure:"dest"`

	// Unique name for this set of templates
	Identity string `mapstructure:"identity"`

	// Key Value pairs to add context to template engine
	Properties map[string]any `mapstructure:"properties"`
}

type ProviderType

type ProviderType string
const (
	Flagsmith ProviderType = "flagsmith"
)

Jump to

Keyboard shortcuts

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