secret

package
v0.0.708 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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