secret

package
v1.1.18 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package secret implements an agent to read and reload the secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSecrets

func LoadSecrets(paths []string) (map[string][]byte, error)

LoadSecrets loads multiple paths of secrets and add them in a map.

func LoadSingleSecret

func LoadSingleSecret(path string) ([]byte, error)

LoadSingleSecret reads and returns the value of a single file.

Types

type Agent

type Agent struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Agent watches a path and automatically loads the secrets stored.

func (*Agent) GetSecret

func (a *Agent) GetSecret(secretPath string) []byte

GetSecret returns the value of a secret stored in a map.

func (*Agent) GetTokenGenerator

func (a *Agent) GetTokenGenerator(secretPath string) func() []byte

GetTokenGenerator returns a function that gets the value of a given secret.

func (*Agent) Start

func (a *Agent) Start(paths []string) error

Start creates goroutines to monitor the files that contain the secret value.

Jump to

Keyboard shortcuts

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