fake

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeVaultServer

func NewFakeVaultServer(t *testing.T) *httptest.Server

NewFakeVaultServer creates a fake vault http server for testing

func NewVaultClientWithFakeKubernetes

func NewVaultClientWithFakeKubernetes(t *testing.T) (*client.Factory, jxfactory.Factory)

NewVaultClientWithFakeKubernetes creates a new vault client using fake k8s

Types

type FakeClient

type FakeClient struct {
	Data map[string]map[string]interface{}
}

FakeClient a fake vault client implementation

func (*FakeClient) Read

func (f *FakeClient) Read(name string) (map[string]interface{}, error)

Read reads data

func (*FakeClient) String

func (f *FakeClient) String() string

String textual info

func (*FakeClient) Write

func (f *FakeClient) Write(name string, values map[string]interface{}) error

Write writes data

type VaultServer

type VaultServer struct {
	T    *testing.T
	Data map[string]map[string]interface{}
}

VaultServer a fake vault server for unit testing of vault client operations

func (*VaultServer) Handle

func (f *VaultServer) Handle(rw http.ResponseWriter, req *http.Request)

Handle handles the vault RESTS APIs

Jump to

Keyboard shortcuts

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