safe

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path

func Path(dbFile string) (string, error)

Path returns the filepath to the state store (boltdb) used by envoy for persisting encrypted secrets.

Types

type Box

type Box interface {
	Set(*Namespace) error
	Purge(string) error
	Update(*Namespace) error
	Get(string) (*Namespace, error)
	List() ([]string, error)
}

A Box represents the persistent storage of encrypted secrets.

func New

func New(file string) Box

type BoxMock

type BoxMock struct {
	GetMock mBoxMockGet

	ListMock mBoxMockList

	PurgeMock mBoxMockPurge

	SetMock mBoxMockSet

	UpdateMock mBoxMockUpdate
	// contains filtered or unexported fields
}

BoxMock implements Box

func NewBoxMock

func NewBoxMock(t minimock.Tester) *BoxMock

NewBoxMock returns a mock for Box

func (*BoxMock) Get

func (mmGet *BoxMock) Get(s1 string) (np1 *Namespace, err error)

Get implements Box

func (*BoxMock) GetAfterCounter

func (mmGet *BoxMock) GetAfterCounter() uint64

GetAfterCounter returns a count of finished BoxMock.Get invocations

func (*BoxMock) GetBeforeCounter

func (mmGet *BoxMock) GetBeforeCounter() uint64

GetBeforeCounter returns a count of BoxMock.Get invocations

func (*BoxMock) List

func (mmList *BoxMock) List() (sa1 []string, err error)

List implements Box

func (*BoxMock) ListAfterCounter

func (mmList *BoxMock) ListAfterCounter() uint64

ListAfterCounter returns a count of finished BoxMock.List invocations

func (*BoxMock) ListBeforeCounter

func (mmList *BoxMock) ListBeforeCounter() uint64

ListBeforeCounter returns a count of BoxMock.List invocations

func (*BoxMock) MinimockFinish

func (m *BoxMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*BoxMock) MinimockGetDone

func (m *BoxMock) MinimockGetDone() bool

MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations

func (*BoxMock) MinimockGetInspect

func (m *BoxMock) MinimockGetInspect()

MinimockGetInspect logs each unmet expectation

func (*BoxMock) MinimockListDone

func (m *BoxMock) MinimockListDone() bool

MinimockListDone returns true if the count of the List invocations corresponds the number of defined expectations

func (*BoxMock) MinimockListInspect

func (m *BoxMock) MinimockListInspect()

MinimockListInspect logs each unmet expectation

func (*BoxMock) MinimockPurgeDone

func (m *BoxMock) MinimockPurgeDone() bool

MinimockPurgeDone returns true if the count of the Purge invocations corresponds the number of defined expectations

func (*BoxMock) MinimockPurgeInspect

func (m *BoxMock) MinimockPurgeInspect()

MinimockPurgeInspect logs each unmet expectation

func (*BoxMock) MinimockSetDone

func (m *BoxMock) MinimockSetDone() bool

MinimockSetDone returns true if the count of the Set invocations corresponds the number of defined expectations

func (*BoxMock) MinimockSetInspect

func (m *BoxMock) MinimockSetInspect()

MinimockSetInspect logs each unmet expectation

func (*BoxMock) MinimockUpdateDone

func (m *BoxMock) MinimockUpdateDone() bool

MinimockUpdateDone returns true if the count of the Update invocations corresponds the number of defined expectations

func (*BoxMock) MinimockUpdateInspect

func (m *BoxMock) MinimockUpdateInspect()

MinimockUpdateInspect logs each unmet expectation

func (*BoxMock) MinimockWait

func (m *BoxMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*BoxMock) Purge

func (mmPurge *BoxMock) Purge(s1 string) (err error)

Purge implements Box

func (*BoxMock) PurgeAfterCounter

func (mmPurge *BoxMock) PurgeAfterCounter() uint64

PurgeAfterCounter returns a count of finished BoxMock.Purge invocations

func (*BoxMock) PurgeBeforeCounter

func (mmPurge *BoxMock) PurgeBeforeCounter() uint64

PurgeBeforeCounter returns a count of BoxMock.Purge invocations

func (*BoxMock) Set

func (mmSet *BoxMock) Set(np1 *Namespace) (err error)

Set implements Box

func (*BoxMock) SetAfterCounter

func (mmSet *BoxMock) SetAfterCounter() uint64

SetAfterCounter returns a count of finished BoxMock.Set invocations

func (*BoxMock) SetBeforeCounter

func (mmSet *BoxMock) SetBeforeCounter() uint64

SetBeforeCounter returns a count of BoxMock.Set invocations

func (*BoxMock) Update

func (mmUpdate *BoxMock) Update(np1 *Namespace) (err error)

Update implements Box

func (*BoxMock) UpdateAfterCounter

func (mmUpdate *BoxMock) UpdateAfterCounter() uint64

UpdateAfterCounter returns a count of finished BoxMock.Update invocations

func (*BoxMock) UpdateBeforeCounter

func (mmUpdate *BoxMock) UpdateBeforeCounter() uint64

UpdateBeforeCounter returns a count of BoxMock.Update invocations

type BoxMockGetExpectation

type BoxMockGetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

BoxMockGetExpectation specifies expectation struct of the Box.Get

func (*BoxMockGetExpectation) Then

func (e *BoxMockGetExpectation) Then(np1 *Namespace, err error) *BoxMock

Then sets up Box.Get return parameters for the expectation previously defined by the When method

type BoxMockGetParams

type BoxMockGetParams struct {
	// contains filtered or unexported fields
}

BoxMockGetParams contains parameters of the Box.Get

type BoxMockGetResults

type BoxMockGetResults struct {
	// contains filtered or unexported fields
}

BoxMockGetResults contains results of the Box.Get

type BoxMockListExpectation

type BoxMockListExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

BoxMockListExpectation specifies expectation struct of the Box.List

type BoxMockListResults

type BoxMockListResults struct {
	// contains filtered or unexported fields
}

BoxMockListResults contains results of the Box.List

type BoxMockPurgeExpectation

type BoxMockPurgeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

BoxMockPurgeExpectation specifies expectation struct of the Box.Purge

func (*BoxMockPurgeExpectation) Then

func (e *BoxMockPurgeExpectation) Then(err error) *BoxMock

Then sets up Box.Purge return parameters for the expectation previously defined by the When method

type BoxMockPurgeParams

type BoxMockPurgeParams struct {
	// contains filtered or unexported fields
}

BoxMockPurgeParams contains parameters of the Box.Purge

type BoxMockPurgeResults

type BoxMockPurgeResults struct {
	// contains filtered or unexported fields
}

BoxMockPurgeResults contains results of the Box.Purge

type BoxMockSetExpectation

type BoxMockSetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

BoxMockSetExpectation specifies expectation struct of the Box.Set

func (*BoxMockSetExpectation) Then

func (e *BoxMockSetExpectation) Then(err error) *BoxMock

Then sets up Box.Set return parameters for the expectation previously defined by the When method

type BoxMockSetParams

type BoxMockSetParams struct {
	// contains filtered or unexported fields
}

BoxMockSetParams contains parameters of the Box.Set

type BoxMockSetResults

type BoxMockSetResults struct {
	// contains filtered or unexported fields
}

BoxMockSetResults contains results of the Box.Set

type BoxMockUpdateExpectation

type BoxMockUpdateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

BoxMockUpdateExpectation specifies expectation struct of the Box.Update

func (*BoxMockUpdateExpectation) Then

func (e *BoxMockUpdateExpectation) Then(err error) *BoxMock

Then sets up Box.Update return parameters for the expectation previously defined by the When method

type BoxMockUpdateParams

type BoxMockUpdateParams struct {
	// contains filtered or unexported fields
}

BoxMockUpdateParams contains parameters of the Box.Update

type BoxMockUpdateResults

type BoxMockUpdateResults struct {
	// contains filtered or unexported fields
}

BoxMockUpdateResults contains results of the Box.Update

type Encrypted

type Encrypted []byte

type Namespace

type Namespace struct {
	Name    string
	Content map[string]Encrypted
}

func (*Namespace) Keys

func (ns *Namespace) Keys() []string

func (*Namespace) String

func (ns *Namespace) String() string

Jump to

Keyboard shortcuts

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