fake

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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
}

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(item *onepassword.Item, vaultUUID string) (*onepassword.Item, error)

CreateItem fake.

func (*OnePasswordMockClient) DeleteItem

func (mockClient *OnePasswordMockClient) DeleteItem(item *onepassword.Item, vaultUUID string) error

DeleteItem fake.

func (*OnePasswordMockClient) GetFile

func (mockClient *OnePasswordMockClient) GetFile(fileUUID, itemUUID, vaultUUID string) (*onepassword.File, error)

GetFile fake.

func (*OnePasswordMockClient) GetFileContent

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

GetFileContent returns file data, you must preload.

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(title, vaultUUID string) (*onepassword.Item, error)

GetItemByTitle fake.

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(uuid string) (*onepassword.Vault, error)

GetVault fake.

func (*OnePasswordMockClient) GetVaults

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

GetVaults fake.

func (*OnePasswordMockClient) GetVaultsByTitle

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

GetVaultsByTitle returns a list of vaults, you must preload.

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(item *onepassword.Item, vaultUUID string) (*onepassword.Item, error)

UpdateItem fake.

Jump to

Keyboard shortcuts

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