backend

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Base64EncodingType is the internal code to represent a base64 encoding
	Base64EncodingType = "base64"

	// TextEncodingType is the internal code to represent a basic text encoding
	TextEncodingType = "text"

	// DefaultEncodingType is the default encoding to use.
	DefaultEncodingType = "text"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base64Decoder

type Base64Decoder struct {
	Encoding string
}

Base64Decoder represents a Decoder for base64 text

func (Base64Decoder) DecodeString

func (d Base64Decoder) DecodeString(input string) ([]byte, error)

DecodeString for Base64Decoder will get the text version (in bytes) of the input base64 text

type Client

type Client interface {
	ReadSecret(path string, key string) (string, error)
}

Client interface represent a backend client interface that should be implemented

func NewBackendClient

func NewBackendClient(ctx context.Context, backend string, logger logr.Logger, cfg Config) (*Client, error)

NewBackendClient returns and implementation of Client interface, given the selected backend

type Config

type Config struct {
	BackendTimeout          time.Duration
	VaultURL                string
	VaultAuthMethod         string
	VaultRoleID             string
	VaultSecretID           string
	VaultKubernetesRole     string
	VaultMaxTokenTTL        int64
	VaultTokenPollingPeriod time.Duration
	VaultRenewTTLIncrement  int
	VaultEngine             string
	VaultApprolePath        string
	VaultKubernetesPath     string
}

Config type represent backend config, and should include all backends config

type Decoder

type Decoder interface {
	DecodeString(input string) ([]byte, error)
}

Decoder interface represents anything that can implement DecodeString: get some bytes from input string

func NewDecoder

func NewDecoder(encoding string) (Decoder, error)

NewDecoder returns a new Decoder implementation or an error if the provided encoding is not implemented

type TextDecoder

type TextDecoder struct {
	Encoding string
}

TextDecoder represents a Decoder for plain text

func (TextDecoder) DecodeString

func (d TextDecoder) DecodeString(input string) ([]byte, error)

DecodeString for TextDecoder, will simply cast to []bytes the input text

Jump to

Keyboard shortcuts

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