safe

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 13 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
	Delete(string, *set.Set[string]) error
	Purge(string) 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 {
	DeleteMock mBoxMockDelete

	GetMock mBoxMockGet

	ListMock mBoxMockList

	PurgeMock mBoxMockPurge

	SetMock mBoxMockSet
	// contains filtered or unexported fields
}

BoxMock implements Box

func NewBoxMock

func NewBoxMock(t minimock.Tester) *BoxMock

NewBoxMock returns a mock for Box

func (*BoxMock) Delete added in v0.3.0

func (mmDelete *BoxMock) Delete(s1 string, pp1 *set.Set[string]) (err error)

Delete implements Box

func (*BoxMock) DeleteAfterCounter added in v0.3.0

func (mmDelete *BoxMock) DeleteAfterCounter() uint64

DeleteAfterCounter returns a count of finished BoxMock.Delete invocations

func (*BoxMock) DeleteBeforeCounter added in v0.3.0

func (mmDelete *BoxMock) DeleteBeforeCounter() uint64

DeleteBeforeCounter returns a count of BoxMock.Delete invocations

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) MinimockDeleteDone added in v0.3.0

func (m *BoxMock) MinimockDeleteDone() bool

MinimockDeleteDone returns true if the count of the Delete invocations corresponds the number of defined expectations

func (*BoxMock) MinimockDeleteInspect added in v0.3.0

func (m *BoxMock) MinimockDeleteInspect()

MinimockDeleteInspect logs each unmet expectation

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) 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

type BoxMockDeleteExpectation added in v0.3.0

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

BoxMockDeleteExpectation specifies expectation struct of the Box.Delete

func (*BoxMockDeleteExpectation) Then added in v0.3.0

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

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

type BoxMockDeleteParams added in v0.3.0

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

BoxMockDeleteParams contains parameters of the Box.Delete

type BoxMockDeleteResults added in v0.3.0

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

BoxMockDeleteResults contains results of the Box.Delete

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 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