Documentation ¶
Index ¶
- type MemStore
- func (c *MemStore) AccountByName(controllerName, accountName string) (*jujuclient.AccountDetails, error)
- func (c *MemStore) AllAccounts(controllerName string) (map[string]jujuclient.AccountDetails, error)
- func (c *MemStore) AllControllers() (map[string]jujuclient.ControllerDetails, error)
- func (c *MemStore) AllCredentials() (map[string]cloud.CloudCredential, error)
- func (c *MemStore) AllModels(controller, account string) (map[string]jujuclient.ModelDetails, error)
- func (c *MemStore) BootstrapConfigForController(controllerName string) (*jujuclient.BootstrapConfig, error)
- func (c *MemStore) ControllerByName(name string) (*jujuclient.ControllerDetails, error)
- func (c *MemStore) CredentialForCloud(cloudName string) (*cloud.CloudCredential, error)
- func (c *MemStore) CurrentAccount(controllerName string) (string, error)
- func (c *MemStore) CurrentModel(controller, account string) (string, error)
- func (c *MemStore) ModelByName(controller, account, model string) (*jujuclient.ModelDetails, error)
- func (c *MemStore) RemoveAccount(controllerName, accountName string) error
- func (c *MemStore) RemoveController(name string) error
- func (c *MemStore) RemoveModel(controller, account, model string) error
- func (c *MemStore) SetCurrentAccount(controllerName, accountName string) error
- func (c *MemStore) SetCurrentModel(controllerName, accountName, modelName string) error
- func (c *MemStore) UpdateAccount(controllerName, accountName string, details jujuclient.AccountDetails) error
- func (c *MemStore) UpdateBootstrapConfig(controllerName string, cfg jujuclient.BootstrapConfig) error
- func (c *MemStore) UpdateController(name string, one jujuclient.ControllerDetails) error
- func (c *MemStore) UpdateCredential(cloudName string, details cloud.CloudCredential) error
- func (c *MemStore) UpdateModel(controller, account, model string, details jujuclient.ModelDetails) error
- type StubStore
- func (c *StubStore) AccountByName(controllerName, accountName string) (*jujuclient.AccountDetails, error)
- func (c *StubStore) AllAccounts(controllerName string) (map[string]jujuclient.AccountDetails, error)
- func (c *StubStore) AllControllers() (map[string]jujuclient.ControllerDetails, error)
- func (c *StubStore) AllCredentials() (map[string]cloud.CloudCredential, error)
- func (c *StubStore) AllModels(controller, account string) (map[string]jujuclient.ModelDetails, error)
- func (c *StubStore) BootstrapConfigForController(controllerName string) (*jujuclient.BootstrapConfig, error)
- func (c *StubStore) ControllerByName(name string) (*jujuclient.ControllerDetails, error)
- func (c *StubStore) CredentialForCloud(cloudName string) (*cloud.CloudCredential, error)
- func (c *StubStore) CurrentAccount(controllerName string) (string, error)
- func (c *StubStore) CurrentModel(controller, account string) (string, error)
- func (c *StubStore) ModelByName(controller, account, model string) (*jujuclient.ModelDetails, error)
- func (c *StubStore) RemoveAccount(controllerName, accountName string) error
- func (c *StubStore) RemoveController(name string) error
- func (c *StubStore) RemoveModel(controller, account, model string) error
- func (c *StubStore) SetCurrentAccount(controllerName, accountName string) error
- func (c *StubStore) SetCurrentModel(controller, account, model string) error
- func (c *StubStore) UpdateAccount(controllerName, accountName string, details jujuclient.AccountDetails) error
- func (c *StubStore) UpdateBootstrapConfig(controllerName string, cfg jujuclient.BootstrapConfig) error
- func (c *StubStore) UpdateController(name string, one jujuclient.ControllerDetails) error
- func (c *StubStore) UpdateCredential(cloudName string, details cloud.CloudCredential) error
- func (c *StubStore) UpdateModel(controller, account, model string, details jujuclient.ModelDetails) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct { Controllers map[string]jujuclient.ControllerDetails Models map[string]jujuclient.ControllerAccountModels Accounts map[string]*jujuclient.ControllerAccounts Credentials map[string]cloud.CloudCredential BootstrapConfig map[string]jujuclient.BootstrapConfig }
MemStore is an in-memory implementation of jujuclient.ClientStore, intended for testing.
func NewMemStore ¶
func NewMemStore() *MemStore
func (*MemStore) AccountByName ¶
func (c *MemStore) AccountByName(controllerName, accountName string) (*jujuclient.AccountDetails, error)
AccountByName implements AccountGetter.
func (*MemStore) AllAccounts ¶
func (c *MemStore) AllAccounts(controllerName string) (map[string]jujuclient.AccountDetails, error)
AllAccounts implements AccountGetter.
func (*MemStore) AllControllers ¶
func (c *MemStore) AllControllers() (map[string]jujuclient.ControllerDetails, error)
AllController implements ControllerGetter.AllController
func (*MemStore) AllCredentials ¶
func (c *MemStore) AllCredentials() (map[string]cloud.CloudCredential, error)
AllCredentials implements CredentialsGetter.
func (*MemStore) AllModels ¶
func (c *MemStore) AllModels(controller, account string) (map[string]jujuclient.ModelDetails, error)
AllModels implements ModelGetter.
func (*MemStore) BootstrapConfigForController ¶
func (c *MemStore) BootstrapConfigForController(controllerName string) (*jujuclient.BootstrapConfig, error)
BootstrapConfigForController implements BootstrapConfigGetter.
func (*MemStore) ControllerByName ¶
func (c *MemStore) ControllerByName(name string) (*jujuclient.ControllerDetails, error)
ControllerByName implements ControllerGetter.ControllerByName
func (*MemStore) CredentialForCloud ¶
func (c *MemStore) CredentialForCloud(cloudName string) (*cloud.CloudCredential, error)
CredentialForCloud implements CredentialsGetter.
func (*MemStore) CurrentAccount ¶
CurrentAccount implements AccountGetter.
func (*MemStore) CurrentModel ¶
CurrentModel implements ModelGetter.
func (*MemStore) ModelByName ¶
func (c *MemStore) ModelByName(controller, account, model string) (*jujuclient.ModelDetails, error)
ModelByName implements ModelGetter.
func (*MemStore) RemoveAccount ¶
RemoveAccount implements AccountRemover.
func (*MemStore) RemoveController ¶
RemoveController implements ControllerRemover.RemoveController
func (*MemStore) RemoveModel ¶
RemoveModel implements ModelRemover.
func (*MemStore) SetCurrentAccount ¶
SetCurrentAccount implements AccountUpdater.
func (*MemStore) SetCurrentModel ¶
SetCurrentModel implements ModelUpdater.
func (*MemStore) UpdateAccount ¶
func (c *MemStore) UpdateAccount(controllerName, accountName string, details jujuclient.AccountDetails) error
UpdateAccount implements AccountUpdater.
func (*MemStore) UpdateBootstrapConfig ¶
func (c *MemStore) UpdateBootstrapConfig(controllerName string, cfg jujuclient.BootstrapConfig) error
UpdateBootstrapConfig implements BootstrapConfigUpdater.
func (*MemStore) UpdateController ¶
func (c *MemStore) UpdateController(name string, one jujuclient.ControllerDetails) error
UpdateController implements ControllerUpdater.UpdateController
func (*MemStore) UpdateCredential ¶
func (c *MemStore) UpdateCredential(cloudName string, details cloud.CloudCredential) error
UpdateCredential implements CredentialsUpdater.
func (*MemStore) UpdateModel ¶
func (c *MemStore) UpdateModel(controller, account, model string, details jujuclient.ModelDetails) error
UpdateModel implements ModelUpdater.
type StubStore ¶
type StubStore struct { *testing.Stub AllControllersFunc func() (map[string]jujuclient.ControllerDetails, error) ControllerByNameFunc func(name string) (*jujuclient.ControllerDetails, error) UpdateControllerFunc func(name string, one jujuclient.ControllerDetails) error RemoveControllerFunc func(name string) error UpdateModelFunc func(controller, account, model string, details jujuclient.ModelDetails) error SetCurrentModelFunc func(controller, account, model string) error RemoveModelFunc func(controller, account, model string) error AllModelsFunc func(controller, account string) (map[string]jujuclient.ModelDetails, error) CurrentModelFunc func(controller, account string) (string, error) ModelByNameFunc func(controller, account, model string) (*jujuclient.ModelDetails, error) UpdateAccountFunc func(controllerName, accountName string, details jujuclient.AccountDetails) error SetCurrentAccountFunc func(controllerName, accountName string) error AllAccountsFunc func(controllerName string) (map[string]jujuclient.AccountDetails, error) CurrentAccountFunc func(controllerName string) (string, error) AccountByNameFunc func(controllerName, accountName string) (*jujuclient.AccountDetails, error) RemoveAccountFunc func(controllerName, accountName string) error CredentialForCloudFunc func(string) (*cloud.CloudCredential, error) AllCredentialsFunc func() (map[string]cloud.CloudCredential, error) UpdateCredentialFunc func(cloudName string, details cloud.CloudCredential) error BootstrapConfigForControllerFunc func(controllerName string) (*jujuclient.BootstrapConfig, error) UpdateBootstrapConfigFunc func(controllerName string, cfg jujuclient.BootstrapConfig) error }
func NewStubStore ¶
func NewStubStore() *StubStore
func WrapClientStore ¶
func WrapClientStore(underlying jujuclient.ClientStore) *StubStore
WrapClientStore wraps a ClientStore with a StubStore, where each method calls through to the wrapped store. This can be used to override specific methods, or just to check which calls have been made.
func (*StubStore) AccountByName ¶
func (c *StubStore) AccountByName(controllerName, accountName string) (*jujuclient.AccountDetails, error)
AccountByName implements AccountGetter.
func (*StubStore) AllAccounts ¶
func (c *StubStore) AllAccounts(controllerName string) (map[string]jujuclient.AccountDetails, error)
AllAccounts implements AccountGetter.
func (*StubStore) AllControllers ¶
func (c *StubStore) AllControllers() (map[string]jujuclient.ControllerDetails, error)
AllControllers implements ControllersGetter.AllControllers
func (*StubStore) AllCredentials ¶
func (c *StubStore) AllCredentials() (map[string]cloud.CloudCredential, error)
AllCredentials implements CredentialsGetter.
func (*StubStore) AllModels ¶
func (c *StubStore) AllModels(controller, account string) (map[string]jujuclient.ModelDetails, error)
AllModels implements ModelGetter.
func (*StubStore) BootstrapConfigForController ¶
func (c *StubStore) BootstrapConfigForController(controllerName string) (*jujuclient.BootstrapConfig, error)
BootstrapConfigForController implements BootstrapConfigGetter.
func (*StubStore) ControllerByName ¶
func (c *StubStore) ControllerByName(name string) (*jujuclient.ControllerDetails, error)
ControllerByName implements ControllersGetter.ControllerByName
func (*StubStore) CredentialForCloud ¶
func (c *StubStore) CredentialForCloud(cloudName string) (*cloud.CloudCredential, error)
CredentialForCloud implements CredentialsGetter.
func (*StubStore) CurrentAccount ¶
CurrentAccount implements AccountGetter.
func (*StubStore) CurrentModel ¶
CurrentModel implements ModelGetter.
func (*StubStore) ModelByName ¶
func (c *StubStore) ModelByName(controller, account, model string) (*jujuclient.ModelDetails, error)
ModelByName implements ModelGetter.
func (*StubStore) RemoveAccount ¶
RemoveAccount implements AccountRemover.
func (*StubStore) RemoveController ¶
RemoveController implements ControllersRemover.RemoveController
func (*StubStore) RemoveModel ¶
RemoveModel implements ModelRemover.
func (*StubStore) SetCurrentAccount ¶
SetCurrentAccount implements AccountUpdater.
func (*StubStore) SetCurrentModel ¶
SetCurrentModel implements ModelUpdater.
func (*StubStore) UpdateAccount ¶
func (c *StubStore) UpdateAccount(controllerName, accountName string, details jujuclient.AccountDetails) error
UpdateAccount implements AccountUpdater.
func (*StubStore) UpdateBootstrapConfig ¶
func (c *StubStore) UpdateBootstrapConfig(controllerName string, cfg jujuclient.BootstrapConfig) error
UpdateBootstrapConfig implements BootstrapConfigUpdater.
func (*StubStore) UpdateController ¶
func (c *StubStore) UpdateController(name string, one jujuclient.ControllerDetails) error
UpdateController implements ControllersUpdater.UpdateController
func (*StubStore) UpdateCredential ¶
func (c *StubStore) UpdateCredential(cloudName string, details cloud.CloudCredential) error
UpdateCredential implements CredentialsUpdater.
func (*StubStore) UpdateModel ¶
func (c *StubStore) UpdateModel(controller, account, model string, details jujuclient.ModelDetails) error
UpdateModel implements ModelUpdater.