backend

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package backend implements the logic and data structures to handle external backend backends. Each external secret implementation will reside in its own package. A "Dummy" backend is provided as reference.

Backends must register their "type" using a function to instantiate themselves. An easy way of doing so is calling the secrets.Register function inside the backend package init() function:

func init() {
	backend.Register("dummy", NewBackend)
}

// NewBackend gives you an new Dummy Backend
func NewBackend() secrets.Backend {
	return &Backend{}
}

Index

Constants

This section is empty.

Variables

View Source
var Functions map[string]func() Backend

Functions is a map of labelled functions that return secret backend instances

View Source
var Instances map[string]Backend

Instances are instantiated secret backends

Functions

func InitFromCtrl added in v0.1.0

func InitFromCtrl(contrl string, config *config.Config, credentials []byte) error

InitFromCtrl initializes within a controller

func InitFromEnv

func InitFromEnv(leaderID string) error

InitFromEnv initializes a backend looking into Env for config data

func Instantiate

func Instantiate(name string, backendType string) error

Instantiate instantiates a Backend of type `backendType`

func Register

func Register(name string, function func() Backend)

Register registers a new backend type with name `name`staging function is a function that returns a backend of that type

Types

type Backend

type Backend interface {
	Init(map[string]interface{}, []byte) error
	Get(string, string) (string, error)
}

Backend is an abstract backend interface

Jump to

Keyboard shortcuts

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