bundle

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: Apache-2.0 Imports: 27 Imported by: 3

Documentation

Overview

Package bundle exposes Bundle object manipulation functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(obj AnnotationOwner, key, value string)

Annotate a bundle object.

func Dump

func Dump(w io.Writer, b *bundlev1.Bundle) error

Dump a file bundle to the writer.

func FromContainer

func FromContainer(c *containerv1.Container) (*bundlev1.Bundle, error)

FromContainer unwraps a Bundle from a secret container.

func FromContainerReader

func FromContainerReader(r io.Reader) (*bundlev1.Bundle, error)

FromContainerReader returns a Bundle extracted from a secret container.

func FromDump added in v0.1.8

func FromDump(r io.Reader) (*bundlev1.Bundle, error)

FromDump creates a bundle from a JSON Dump.

func FromMap

func FromMap(input map[string]KV) (*bundlev1.Bundle, error)

FromMap builds a secret container from map K/V.

func FromOpLog added in v0.1.11

func FromOpLog(oplog compare.OpLog) (*bundlev1.Bundle, error)

FromOpLog convert oplog to a bundle.

func FromSecretMap

func FromSecretMap(secretKv KV) ([]*bundlev1.KV, error)

FromSecretMap returns the protobuf representation of secretMap.

func JSON

func JSON(w io.Writer, b *bundlev1.Bundle) error

JSON export given bundle as a JSON representation.

func Labelize

func Labelize(obj LabelOwner, key, value string)

Labelize a bundle object.

func Load

func Load(r io.Reader) (*bundlev1.Bundle, error)

Load a file bundle from the buffer.

func Lock

func Lock(ctx context.Context, b *bundlev1.Bundle, transformer value.Transformer) error

Lock apply transformer function to all secret values and set as locked.

func Paths

func Paths(b *bundlev1.Bundle) ([]string, error)

Paths returns bundle secret paths.

func Read

func Read(b *bundlev1.Bundle, secretPath string) (map[string]interface{}, error)

Read a secret located at secretPath from the given bundle.

func SecretReader

func SecretReader(b *bundlev1.Bundle) func(path string) (map[string]interface{}, error)

SecretReader is used by template engine to resolve secret from secret container.

func ToContainer

func ToContainer(b *bundlev1.Bundle) (*containerv1.Container, error)

ToContainer wrpas a Bundle as a container object.

func ToContainerWriter

func ToContainerWriter(w io.Writer, b *bundlev1.Bundle) error

ToContainerWriter returns a Bundle packaged as a secret container.

func UnLock

func UnLock(ctx context.Context, b *bundlev1.Bundle, transformer value.Transformer) error

UnLock apply transformer function to all secret values and set as unlocked.

Types

type AnnotationOwner

type AnnotationOwner interface {
	GetAnnotations() map[string]string
}

AnnotationOwner defines annotations owner contract

type KV

type KV map[string]interface{}

KV describes map[string]interface{} alias

func AsMap

func AsMap(b *bundlev1.Bundle) (KV, error)

AsMap returns a bundle as map

func AsSecretMap

func AsSecretMap(p *bundlev1.Package) (KV, error)

AsSecretMap returns a KV map from given package.

func (KV) Get

func (kv KV) Get(name string) interface{}

Get returns a KV of the given package.

func (KV) Glob

func (kv KV) Glob(pattern string) KV

Glob returns package objects that have name matching the given pattern.

type LabelOwner

type LabelOwner interface {
	GetLabels() map[string]string
}

LabelOwner defines label owner contract

type Reader

type Reader interface {
	Read(reader io.Reader) (*bundlev1.Bundle, error)
}

Reader exposes bundle reader contract

type Statistic

type Statistic struct {
	PackageCount                 uint32
	CSOCompliantPackageNameCount uint32
	SecretCount                  uint32
}

Statistic hold bundle statistic information

func Tree

Tree returns a merkle tree based on secrets hierarchy

type Visitor

type Visitor interface {
	Error() error
	VisitForFile(obj *bundlev1.Bundle)
	VisitForPackage(obj *bundlev1.Package)
	VisitForChain(obj *bundlev1.SecretChain)
	VisitForKV(obj *bundlev1.KV)
}

Visitor delares the bundle vistor contract.

type Writer

type Writer interface {
	Write(file *bundlev1.Bundle) error
}

Writer exposes bundle writer contract

Jump to

Keyboard shortcuts

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