file

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package file allows to fetch secrets from JSON and YAML files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONBackend

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

JSONBackend represents backend for JSON file

func NewJSONBackend

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

NewJSONBackend returns a new JSON backend

func (*JSONBackend) GetSecretOutput

func (b *JSONBackend) GetSecretOutput(secretKey string) secret.Output

GetSecretOutput returns a the value for a specific secret

type JSONBackendConfig

type JSONBackendConfig struct {
	BackendType string `mapstructure:"backend_type"`
	FilePath    string `mapstructure:"file_path"`
}

JSONBackendConfig is the configuration for a JSON backend

type YamlBackend

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

YamlBackend represents backend for YAML file

func NewYAMLBackend

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

NewYAMLBackend returns a new YAML backend

func (*YamlBackend) GetSecretOutput

func (b *YamlBackend) GetSecretOutput(secretKey string) secret.Output

GetSecretOutput returns a the value for a specific secret

type YamlBackendConfig

type YamlBackendConfig struct {
	BackendType string `mapstructure:"backend_type"`
	FilePath    string `mapstructure:"file_path"`
}

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