file

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package file allows to fetch secrets from JSON and YAML files

Package file allows to fetch secrets from files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONBackend

type JSONBackend struct {
	Config JSONBackendConfig
	Secret map[string]string
}

JSONBackend represents backend for JSON file

func NewJSONBackend

func NewJSONBackend(bc map[string]interface{}) (
	*JSONBackend, error)

NewJSONBackend returns a new JSON backend

func (*JSONBackend) GetSecretOutput

func (b *JSONBackend) GetSecretOutput(_ context.Context, secretKey string) secret.Output

GetSecretOutput returns a the value for a specific secret

type JSONBackendConfig

type JSONBackendConfig struct {
	FilePath        string `mapstructure:"file_path"`
	MaxFileReadSize int64  `mapstructure:"max_file_read_size"`
}

JSONBackendConfig is the configuration for a JSON backend

type TextFileBackend added in v1.5.0

type TextFileBackend struct {
	Config TextFileBackendConfig
}

TextFileBackend represents backend for individual secret files

func NewTextFileBackend added in v1.5.0

func NewTextFileBackend(bc map[string]interface{}) (*TextFileBackend, error)

NewTextFileBackend returns a new file backend

func (*TextFileBackend) GetSecretOutput added in v1.5.0

func (b *TextFileBackend) GetSecretOutput(_ context.Context, secretString string) secret.Output

GetSecretOutput retrieves a secret from a file

type TextFileBackendConfig added in v1.5.0

type TextFileBackendConfig struct {
	SecretsPath     string `mapstructure:"secrets_path"`
	MaxFileReadSize int64  `mapstructure:"max_file_read_size"`
}

TextFileBackendConfig is the configuration for a file backend

type YamlBackend

type YamlBackend struct {
	Config YamlBackendConfig
	Secret map[string]string
}

YamlBackend represents backend for YAML file

func NewYAMLBackend

func NewYAMLBackend(bc map[string]interface{}) (
	*YamlBackend, error)

NewYAMLBackend returns a new YAML backend

func (*YamlBackend) GetSecretOutput

func (b *YamlBackend) GetSecretOutput(_ context.Context, secretKey string) secret.Output

GetSecretOutput returns a the value for a specific secret

type YamlBackendConfig

type YamlBackendConfig struct {
	FilePath        string `mapstructure:"file_path"`
	MaxFileReadSize int64  `mapstructure:"max_file_read_size"`
}

YamlBackendConfig is the configuration for a YAML backend

Jump to

Keyboard shortcuts

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