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 ¶
- type OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) AddPredictableItemWithField(vaultName, title, label, value string) *OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) AddPredictableVault(name string) *OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) AppendItem(vaultID string, item onepassword.Item) *OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) AppendItemField(vaultID, itemID string, itemField onepassword.ItemField) *OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) AppendVault(name string, vault onepassword.Vault) *OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) CreateItem(item *onepassword.Item, vaultUUID string) (*onepassword.Item, error)
- func (mockClient *OnePasswordMockClient) DeleteItem(item *onepassword.Item, vaultUUID string) error
- func (mockClient *OnePasswordMockClient) DeleteItemByID(itemUUID, vaultQuery string) error
- func (mockClient *OnePasswordMockClient) DeleteItemByTitle(title, vaultQuery string) error
- func (mockClient *OnePasswordMockClient) DownloadFile(file *onepassword.File, targetDirectory string, overwrite bool) (string, error)
- func (mockClient *OnePasswordMockClient) GetFile(fileUUID, itemUUID, vaultUUID string) (*onepassword.File, error)
- func (mockClient *OnePasswordMockClient) GetFileContent(file *onepassword.File) ([]byte, error)
- func (mockClient *OnePasswordMockClient) GetFiles(itemQuery, vaultQuery string) ([]onepassword.File, error)
- func (mockClient *OnePasswordMockClient) GetItem(itemUUID, vaultUUID string) (*onepassword.Item, error)
- func (mockClient *OnePasswordMockClient) GetItemByTitle(title, vaultUUID string) (*onepassword.Item, error)
- func (mockClient *OnePasswordMockClient) GetItemByUUID(itemUUID, vaultUUID string) (*onepassword.Item, error)
- func (mockClient *OnePasswordMockClient) GetItems(vaultUUID string) ([]onepassword.Item, error)
- func (mockClient *OnePasswordMockClient) GetItemsByTitle(itemUUID, vaultUUID string) ([]onepassword.Item, error)
- func (mockClient *OnePasswordMockClient) GetVault(uuid string) (*onepassword.Vault, error)
- func (mockClient *OnePasswordMockClient) GetVaultByTitle(uuid string) (*onepassword.Vault, error)
- func (mockClient *OnePasswordMockClient) GetVaultByUUID(uuid string) (*onepassword.Vault, error)
- func (mockClient *OnePasswordMockClient) GetVaults() ([]onepassword.Vault, error)
- func (mockClient *OnePasswordMockClient) GetVaultsByTitle(uuid string) ([]onepassword.Vault, error)
- func (mockClient *OnePasswordMockClient) LoadStruct(config interface{}) error
- func (mockClient *OnePasswordMockClient) LoadStructFromItem(config interface{}, itemQuery, vaultQuery string) error
- func (mockClient *OnePasswordMockClient) LoadStructFromItemByTitle(config interface{}, itemTitle, vaultQuery string) error
- func (mockClient *OnePasswordMockClient) LoadStructFromItemByUUID(config interface{}, itemUUID, vaultQuery string) error
- func (mockClient *OnePasswordMockClient) SetFileContents(name string, contents []byte) *OnePasswordMockClient
- func (mockClient *OnePasswordMockClient) UpdateItem(item *onepassword.Item, vaultUUID string) (*onepassword.Item, error)
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 unused fake.
func (*OnePasswordMockClient) DeleteItem ¶
func (mockClient *OnePasswordMockClient) DeleteItem(item *onepassword.Item, vaultUUID string) error
DeleteItem unused fake.
func (*OnePasswordMockClient) DeleteItemByID ¶
func (mockClient *OnePasswordMockClient) DeleteItemByID(itemUUID, vaultQuery string) error
DeleteItemByID unused fake.
func (*OnePasswordMockClient) DeleteItemByTitle ¶
func (mockClient *OnePasswordMockClient) DeleteItemByTitle(title, vaultQuery string) error
DeleteItemByTitle unused fake.
func (*OnePasswordMockClient) DownloadFile ¶
func (mockClient *OnePasswordMockClient) DownloadFile(file *onepassword.File, targetDirectory string, overwrite bool) (string, error)
DownloadFile unused fake.
func (*OnePasswordMockClient) GetFile ¶
func (mockClient *OnePasswordMockClient) GetFile(fileUUID, itemUUID, vaultUUID 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 ¶
func (mockClient *OnePasswordMockClient) GetFiles(itemQuery, vaultQuery 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(title, vaultUUID string) (*onepassword.Item, error)
GetItemByTitle unused fake.
func (*OnePasswordMockClient) GetItemByUUID ¶
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(uuid string) (*onepassword.Vault, error)
GetVault unused fake.
func (*OnePasswordMockClient) GetVaultByTitle ¶
func (mockClient *OnePasswordMockClient) GetVaultByTitle(uuid string) (*onepassword.Vault, error)
GetVaultByTitle returns a vault, you must preload, only one.
func (*OnePasswordMockClient) GetVaultByUUID ¶
func (mockClient *OnePasswordMockClient) GetVaultByUUID(uuid 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 ¶
func (mockClient *OnePasswordMockClient) LoadStruct(config interface{}) error
LoadStructunused fake.
func (*OnePasswordMockClient) LoadStructFromItem ¶
func (mockClient *OnePasswordMockClient) LoadStructFromItem(config interface{}, itemQuery, vaultQuery string) error
LoadStructFromItem unused fake.
func (*OnePasswordMockClient) LoadStructFromItemByTitle ¶
func (mockClient *OnePasswordMockClient) LoadStructFromItemByTitle(config interface{}, itemTitle, vaultQuery string) error
LoadStructFromItemByTitle unused fake.
func (*OnePasswordMockClient) LoadStructFromItemByUUID ¶
func (mockClient *OnePasswordMockClient) LoadStructFromItemByUUID(config interface{}, itemUUID, vaultQuery 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(item *onepassword.Item, vaultUUID string) (*onepassword.Item, error)
UpdateItem unused fake.