config

package
v1.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EnvProviderConfigPathsEnvKey holds config paths separated by comma.
	EnvProviderConfigPathsEnvKey = "BOTKUBE_CONFIG_PATHS"
)

Variables

This section is empty.

Functions

func GetProvider added in v1.0.0

func GetProvider(remoteCfgSyncEnabled bool, deployClient DeploymentClient) config.Provider

GetProvider resolves and returns paths for config files. It reads them the 'BOTKUBE_CONFIG_PATHS' env variable. If not found, then it uses '--config' flag.

func RegisterFlags added in v1.0.0

func RegisterFlags(flags *pflag.FlagSet)

RegisterFlags registers config related flags.

Types

type DeploymentClient added in v1.0.0

type DeploymentClient interface {
	GetConfigWithResourceVersion(ctx context.Context) (remote.Deployment, error)
}

type EnvProvider

type EnvProvider struct {
}

EnvProvider environment config source provider

func NewEnvProvider

func NewEnvProvider() *EnvProvider

NewEnvProvider initializes new environment config source provider

func (*EnvProvider) Configs

func (e *EnvProvider) Configs(ctx context.Context) (config.YAMLFiles, int, error)

Configs returns list of config file locations

type FileSystemProvider

type FileSystemProvider struct {
	Files []string
}

FileSystemProvider allows consumer to pass config files statically

func NewFileSystemProvider

func NewFileSystemProvider(configs []string) *FileSystemProvider

NewFileSystemProvider initializes new static config source provider

func (*FileSystemProvider) Configs

Configs returns list of config file locations.

type GqlProvider

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

GqlProvider is GraphQL provider

func NewGqlProvider

func NewGqlProvider(dc DeploymentClient) *GqlProvider

NewGqlProvider initializes new GraphQL config source provider

func (*GqlProvider) Configs

func (g *GqlProvider) Configs(ctx context.Context) (config.YAMLFiles, int, error)

Configs returns list of config files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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