keyring

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(name string) secrets.Text

Init will acquire the secret that envy uses to encrypt values from the OS keyring provider.

Types

type Ring

type Ring interface {
	Encrypt(secrets.Text) safe.Encrypted
	Decrypt(safe.Encrypted) secrets.Text
}

A Ring is used to encrypt and decrypt secrets.

func New

func New(key secrets.Text) Ring

type RingMock

type RingMock struct {
	DecryptMock mRingMockDecrypt

	EncryptMock mRingMockEncrypt
	// contains filtered or unexported fields
}

RingMock implements Ring

func NewRingMock

func NewRingMock(t minimock.Tester) *RingMock

NewRingMock returns a mock for Ring

func (*RingMock) Decrypt

func (mmDecrypt *RingMock) Decrypt(e1 safe.Encrypted) (t1 secrets.Text)

Decrypt implements Ring

func (*RingMock) DecryptAfterCounter

func (mmDecrypt *RingMock) DecryptAfterCounter() uint64

DecryptAfterCounter returns a count of finished RingMock.Decrypt invocations

func (*RingMock) DecryptBeforeCounter

func (mmDecrypt *RingMock) DecryptBeforeCounter() uint64

DecryptBeforeCounter returns a count of RingMock.Decrypt invocations

func (*RingMock) Encrypt

func (mmEncrypt *RingMock) Encrypt(t1 secrets.Text) (e1 safe.Encrypted)

Encrypt implements Ring

func (*RingMock) EncryptAfterCounter

func (mmEncrypt *RingMock) EncryptAfterCounter() uint64

EncryptAfterCounter returns a count of finished RingMock.Encrypt invocations

func (*RingMock) EncryptBeforeCounter

func (mmEncrypt *RingMock) EncryptBeforeCounter() uint64

EncryptBeforeCounter returns a count of RingMock.Encrypt invocations

func (*RingMock) MinimockDecryptDone

func (m *RingMock) MinimockDecryptDone() bool

MinimockDecryptDone returns true if the count of the Decrypt invocations corresponds the number of defined expectations

func (*RingMock) MinimockDecryptInspect

func (m *RingMock) MinimockDecryptInspect()

MinimockDecryptInspect logs each unmet expectation

func (*RingMock) MinimockEncryptDone

func (m *RingMock) MinimockEncryptDone() bool

MinimockEncryptDone returns true if the count of the Encrypt invocations corresponds the number of defined expectations

func (*RingMock) MinimockEncryptInspect

func (m *RingMock) MinimockEncryptInspect()

MinimockEncryptInspect logs each unmet expectation

func (*RingMock) MinimockFinish

func (m *RingMock) MinimockFinish()

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

func (*RingMock) MinimockWait

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

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

type RingMockDecryptExpectation

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

RingMockDecryptExpectation specifies expectation struct of the Ring.Decrypt

func (*RingMockDecryptExpectation) Then

Then sets up Ring.Decrypt return parameters for the expectation previously defined by the When method

type RingMockDecryptParams

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

RingMockDecryptParams contains parameters of the Ring.Decrypt

type RingMockDecryptResults

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

RingMockDecryptResults contains results of the Ring.Decrypt

type RingMockEncryptExpectation

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

RingMockEncryptExpectation specifies expectation struct of the Ring.Encrypt

func (*RingMockEncryptExpectation) Then

Then sets up Ring.Encrypt return parameters for the expectation previously defined by the When method

type RingMockEncryptParams

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

RingMockEncryptParams contains parameters of the Ring.Encrypt

type RingMockEncryptResults

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

RingMockEncryptResults contains results of the Ring.Encrypt

Jump to

Keyboard shortcuts

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