fake

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnePasswordMockClient

type OnePasswordMockClient struct {
	MockVaults             map[string][]onepassword.Vault
	MockItems              map[string][]onepassword.Item // ID and Title only
	MockItemFields         map[string]map[string][]*onepassword.ItemField
	MockFileContents       map[string][]byte
	UpdateItemValidateFunc func(*onepassword.Item, string) (*onepassword.Item, error)
	CreateItemValidateFunc func(*onepassword.Item, string) (*onepassword.Item, error)
	DeleteItemValidateFunc func(*onepassword.Item, string) error
}

OnePasswordMockClient is a fake connect.Client.

func NewMockClient

func NewMockClient() *OnePasswordMockClient

NewMockClient returns an instantiated mock client.

func (*OnePasswordMockClient) AddPredictableItemWithField

func (mockClient *OnePasswordMockClient) AddPredictableItemWithField(vaultName, title, label, value string) *OnePasswordMockClient

AddPredictableItemWithField adds an item and it's fields to the mock client in a predictable way.

func (*OnePasswordMockClient) AddPredictableVault

func (mockClient *OnePasswordMockClient) AddPredictableVault(name string) *OnePasswordMockClient

AddPredictableVault adds vaults to the mock client in a predictable way.

func (*OnePasswordMockClient) AppendItem

func (mockClient *OnePasswordMockClient) AppendItem(vaultID string, item onepassword.Item) *OnePasswordMockClient

AppendItem appends a onepassword.Item to the mock client.

func (*OnePasswordMockClient) AppendItemField

func (mockClient *OnePasswordMockClient) AppendItemField(vaultID, itemID string, itemField onepassword.ItemField) *OnePasswordMockClient

AppendItemField appends a onepassword.ItemField to the mock client.

func (*OnePasswordMockClient) AppendVault

func (mockClient *OnePasswordMockClient) AppendVault(name string, vault onepassword.Vault) *OnePasswordMockClient

AppendVault appends a onepassword.Vault to the mock client.

func (*OnePasswordMockClient) CreateItem

func (mockClient *OnePasswordMockClient) CreateItem(i *onepassword.Item, s string) (*onepassword.Item, error)

CreateItem will call a validation function if set.

func (*OnePasswordMockClient) DeleteItem

func (mockClient *OnePasswordMockClient) DeleteItem(i *onepassword.Item, s string) error

DeleteItem will call a validation function if set.

func (*OnePasswordMockClient) DeleteItemByID added in v0.5.7

func (mockClient *OnePasswordMockClient) DeleteItemByID(_, _ string) error

DeleteItemByID unused fake.

func (*OnePasswordMockClient) DeleteItemByTitle added in v0.5.9

func (mockClient *OnePasswordMockClient) DeleteItemByTitle(_, _ string) error

DeleteItemByTitle unused fake.

func (*OnePasswordMockClient) DownloadFile added in v0.5.7

func (mockClient *OnePasswordMockClient) DownloadFile(_ *onepassword.File, _ string, _ bool) (string, error)

DownloadFile unused fake.

func (*OnePasswordMockClient) GetFile

func (mockClient *OnePasswordMockClient) GetFile(_, _, _ string) (*onepassword.File, error)

GetFile unused fake.

func (*OnePasswordMockClient) GetFileContent

func (mockClient *OnePasswordMockClient) GetFileContent(file *onepassword.File) ([]byte, error)

GetFileContent returns file data, you must preload.

func (*OnePasswordMockClient) GetFiles added in v0.5.7

func (mockClient *OnePasswordMockClient) GetFiles(_, _ string) ([]onepassword.File, error)

GetFiles unused fake.

func (*OnePasswordMockClient) GetItem

func (mockClient *OnePasswordMockClient) GetItem(itemUUID, vaultUUID string) (*onepassword.Item, error)

GetItem returns a *onepassword.Item, you must preload.

func (*OnePasswordMockClient) GetItemByTitle

func (mockClient *OnePasswordMockClient) GetItemByTitle(_, _ string) (*onepassword.Item, error)

GetItemByTitle unused fake.

func (*OnePasswordMockClient) GetItemByUUID added in v0.5.7

func (mockClient *OnePasswordMockClient) GetItemByUUID(itemUUID, vaultUUID string) (*onepassword.Item, error)

GetItemByUUID returns a *onepassword.Item, you must preload.

func (*OnePasswordMockClient) GetItems

func (mockClient *OnePasswordMockClient) GetItems(vaultUUID string) ([]onepassword.Item, error)

GetItems returns []onepassword.Item, you must preload.

func (*OnePasswordMockClient) GetItemsByTitle

func (mockClient *OnePasswordMockClient) GetItemsByTitle(itemUUID, vaultUUID string) ([]onepassword.Item, error)

GetItemsByTitle returns a list of items, you must preload.

func (*OnePasswordMockClient) GetVault

func (mockClient *OnePasswordMockClient) GetVault(_ string) (*onepassword.Vault, error)

GetVault unused fake.

func (*OnePasswordMockClient) GetVaultByTitle added in v0.5.7

func (mockClient *OnePasswordMockClient) GetVaultByTitle(uuid string) (*onepassword.Vault, error)

GetVaultByTitle returns a vault, you must preload, only one.

func (*OnePasswordMockClient) GetVaultByUUID added in v0.5.7

func (mockClient *OnePasswordMockClient) GetVaultByUUID(_ string) (*onepassword.Vault, error)

GetVaultByUUID unused fake.

func (*OnePasswordMockClient) GetVaults

func (mockClient *OnePasswordMockClient) GetVaults() ([]onepassword.Vault, error)

GetVaults unused fake.

func (*OnePasswordMockClient) GetVaultsByTitle

func (mockClient *OnePasswordMockClient) GetVaultsByTitle(uuid string) ([]onepassword.Vault, error)

GetVaultsByTitle returns a list of vaults, you must preload.

func (*OnePasswordMockClient) LoadStruct added in v0.5.7

func (mockClient *OnePasswordMockClient) LoadStruct(_ interface{}) error

LoadStructunused fake.

func (*OnePasswordMockClient) LoadStructFromItem added in v0.5.7

func (mockClient *OnePasswordMockClient) LoadStructFromItem(_ interface{}, _, _ string) error

LoadStructFromItem unused fake.

func (*OnePasswordMockClient) LoadStructFromItemByTitle added in v0.5.7

func (mockClient *OnePasswordMockClient) LoadStructFromItemByTitle(_ interface{}, _, _ string) error

LoadStructFromItemByTitle unused fake.

func (*OnePasswordMockClient) LoadStructFromItemByUUID added in v0.5.7

func (mockClient *OnePasswordMockClient) LoadStructFromItemByUUID(_ interface{}, _, _ string) error

LoadStructFromItemByUUID unused fake.

func (*OnePasswordMockClient) SetFileContents

func (mockClient *OnePasswordMockClient) SetFileContents(name string, contents []byte) *OnePasswordMockClient

SetFileContents adds file contents to the mock client.

func (*OnePasswordMockClient) UpdateItem

func (mockClient *OnePasswordMockClient) UpdateItem(i *onepassword.Item, s string) (*onepassword.Item, error)

UpdateItem will call a validation function if set.

Jump to

Keyboard shortcuts

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