fake

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	LoginFn LoginFn
}

func NewVaultAuth

func NewVaultAuth() Auth

func (Auth) Login

func (f Auth) Login(ctx context.Context, authMethod vault.AuthMethod) (*vault.Secret, error)

type ListWithContextFn

type ListWithContextFn func(ctx context.Context, path string) (*vault.Secret, error)

type Logical

type Logical struct {
	ReadWithDataWithContextFn ReadWithDataWithContextFn
	ListWithContextFn         ListWithContextFn
	WriteWithContextFn        WriteWithContextFn
}

func NewVaultLogical

func NewVaultLogical() Logical

func (Logical) ListWithContext

func (f Logical) ListWithContext(ctx context.Context, path string) (*vault.Secret, error)

func (Logical) ReadWithDataWithContext

func (f Logical) ReadWithDataWithContext(ctx context.Context, path string, data map[string][]string) (*vault.Secret, error)

func (Logical) WriteWithContext

func (f Logical) WriteWithContext(ctx context.Context, path string, data map[string]interface{}) (*vault.Secret, error)

type LoginFn

type LoginFn func(ctx context.Context, authMethod vault.AuthMethod) (*vault.Secret, error)

type LookupSelfWithContextFn

type LookupSelfWithContextFn func(ctx context.Context) (*vault.Secret, error)

type MockAddHeaderFn

type MockAddHeaderFn func(key, value string)

func NewAddHeaderFn

func NewAddHeaderFn() MockAddHeaderFn

type MockClearTokenFn

type MockClearTokenFn func()

func NewClearTokenFn

func NewClearTokenFn() MockClearTokenFn

type MockSetNamespaceFn

type MockSetNamespaceFn func(namespace string)

func NewSetNamespaceFn

func NewSetNamespaceFn() MockSetNamespaceFn

type MockSetTokenFn

type MockSetTokenFn func(v string)

func NewSetTokenFn

func NewSetTokenFn(ofn ...func(v string)) MockSetTokenFn

type MockTokenFn

type MockTokenFn func() string

func NewTokenFn

func NewTokenFn(v string) MockTokenFn

type ReadWithDataWithContextFn

type ReadWithDataWithContextFn func(ctx context.Context, path string, data map[string][]string) (*vault.Secret, error)

func NewReadWithContextFn

func NewReadWithContextFn(secret map[string]interface{}, err error) ReadWithDataWithContextFn

type RevokeSelfWithContextFn

type RevokeSelfWithContextFn func(ctx context.Context, token string) error

type Token

type Token struct {
	RevokeSelfWithContextFn RevokeSelfWithContextFn
	LookupSelfWithContextFn LookupSelfWithContextFn
}

func (Token) LookupSelfWithContext

func (f Token) LookupSelfWithContext(ctx context.Context) (*vault.Secret, error)

func (Token) RevokeSelfWithContext

func (f Token) RevokeSelfWithContext(ctx context.Context, token string) error

type VaultClient

type VaultClient struct {
	MockLogical      Logical
	MockAuth         Auth
	MockAuthToken    Token
	MockSetToken     MockSetTokenFn
	MockToken        MockTokenFn
	MockClearToken   MockClearTokenFn
	MockSetNamespace MockSetNamespaceFn
	MockAddHeader    MockAddHeaderFn
}

func (*VaultClient) AddHeader

func (c *VaultClient) AddHeader(key, value string)

func (*VaultClient) Auth

func (c *VaultClient) Auth() Auth

func (*VaultClient) AuthToken

func (c *VaultClient) AuthToken() Token

func (*VaultClient) ClearToken

func (c *VaultClient) ClearToken()

func (*VaultClient) Logical

func (c *VaultClient) Logical() Logical

func (*VaultClient) SetNamespace

func (c *VaultClient) SetNamespace(namespace string)

func (*VaultClient) SetToken

func (c *VaultClient) SetToken(v string)

func (*VaultClient) Token

func (c *VaultClient) Token() string

type VaultListResponse

type VaultListResponse struct {
	Metadata *vault.Response
	Data     *vault.Response
}

type WriteWithContextFn

type WriteWithContextFn func(ctx context.Context, path string, data map[string]interface{}) (*vault.Secret, error)

Jump to

Keyboard shortcuts

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