config_loader

package
v0.0.0-...-982e07a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EncryptoConfigStorageTypeConsul     = "consul"
	EncryptoConfigStorageTypeFilesystem = "filesystem"
)

represent all possible encryptor config loader types

Variables

View Source
var (
	// ErrEncryptorConfigStorageNotFound represent an error of missing EncryptorConfigStorage in registry
	ErrEncryptorConfigStorageNotFound = errors.New("ErrEncryptorConfigStorageNotFound not found by storage type")
)

SupportedEncryptorConfigStorages contains all possible values for flag `--encryptor_config_storage_type`

Functions

func GetEncryptorConfigStorage

func GetEncryptorConfigStorage(storageType string, extractor *args.ServiceExtractor, prefix string) (encryptor.ConfigStorage, error)

GetEncryptorConfigStorage returns initialized filesystem.Storage interface depending on incoming storage type

func IsEncryptorConfigLoaderCLIConfigured

func IsEncryptorConfigLoaderCLIConfigured(extractor *args.ServiceExtractor) bool

IsEncryptorConfigLoaderCLIConfigured check weather CLI ConfigStorage flags were configured

func IsEncryptorConfigLoaderCLIConfiguredWithFlags

func IsEncryptorConfigLoaderCLIConfiguredWithFlags(extractor *args.ServiceExtractor, prefix string) bool

IsEncryptorConfigLoaderCLIConfiguredWithFlags check weather CLI ConfigStorage flags of FlagSet were configured

func RegisterEncryptorConfigLoaderCLIWithFlags

func RegisterEncryptorConfigLoaderCLIWithFlags(flag *flag.FlagSet, prefix, description string)

RegisterEncryptorConfigLoaderCLIWithFlags register flags for all fabrics

func RegisterEncryptorConfigLoaderParameters

func RegisterEncryptorConfigLoaderParameters()

RegisterEncryptorConfigLoaderParameters register flags for all fabrics with CommandLine flags

func RegisterEncryptorConfigStorageCreator

func RegisterEncryptorConfigStorageCreator(name string, creator EncryptorConfigStorageCreator)

RegisterEncryptorConfigStorageCreator add new filesystem.Storage to registry

Types

type ConfigLoader

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

ConfigLoader load encryptor config using encryptor.ConfigStorage

func NewConfigLoader

func NewConfigLoader(storageType string, extractor *args.ServiceExtractor, prefix string) (*ConfigLoader, error)

NewConfigLoader create new ConfigLoader

func (*ConfigLoader) Load

func (c *ConfigLoader) Load() ([]byte, error)

Load load EncryptorConfig using encryptor.ConfigStorage

type EncryptorConfigStorageCreator

type EncryptorConfigStorageCreator interface {
	NewStorage(extractor *args.ServiceExtractor, prefix string) (encryptor.ConfigStorage, error)
	RegisterCLIParameters(flags *flag.FlagSet, prefix, description string)
	IsStorageConfigured(extractor *args.ServiceExtractor, prefix string) bool
}

EncryptorConfigStorageCreator describe interface for creating EncryptorConfigStorage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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