control

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.New(os.Stderr, "", 0)

Logger is a STDERR logger

Functions

func Decrypt added in v1.2.0

func Decrypt(ciphertext []byte, key *[32]byte) (plaintext []byte, err error)

Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.

func Encrypt added in v1.2.0

func Encrypt(plaintext []byte, key *[32]byte) (ciphertext []byte, err error)

Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.

func ExecFilter added in v1.0.3

func ExecFilter(file string, filters map[string]string) error

ExecFilter filters an individual file

func Get added in v0.3.0

func Get(location string, headers []string, timeout time.Duration) (io.ReadCloser, error)

Get fetches the control from a location and returns a io.ReadCloser

func NewEncryptionKey added in v1.2.0

func NewEncryptionKey() (*[32]byte, error)

NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt(). It return an error if the source of randomness fails.

Types

type Configuration

type Configuration struct {
	Filters Filters
	BaseDir string
}

Configuration is the overall data structure unmarshalled from JSON

func (*Configuration) DoFilters

func (c *Configuration) DoFilters() error

DoFilters filters the files listed in the Configuration object

func (*Configuration) Read

func (c *Configuration) Read(location string, headers []string, timeout time.Duration, encoded bool) error

Read reads in the configuration and returns the object

type Filter

type Filter map[string]string

Filter is a set of key value pair to be filtered for a file

func (*Filter) UnmarshalJSON added in v1.3.0

func (f *Filter) UnmarshalJSON(b []byte) error

type Filters added in v1.3.0

type Filters map[string]Filter

Filters are a map of file names to key/value pairs

type Modifier added in v1.3.0

type Modifier struct {
	Type  string
	Value string
}

Modifier is the struct representing a value to be modified

type SSM added in v0.4.0

type SSM struct {
	Service ssmiface.SSMAPI
	// contains filtered or unexported fields
}

func NewSSM added in v0.4.0

func NewSSM(opts ...SSMOption) *SSM

New creates an SSM from a list of SSMOption functions

func (*SSM) GetParameter added in v0.4.0

func (s *SSM) GetParameter(path string) (string, error)

type SSMOption added in v0.4.0

type SSMOption func(*SSM)

SSMOption is a function to set ssm options

Jump to

Keyboard shortcuts

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