Documentation
¶
Overview ¶
Package cloudtest is a cloud.Cloud a test programs, which counts what it's asked. Only tests import it.
Index ¶
- type Fake
- func (f *Fake) EmptyEnvironment()
- func (f *Fake) Identity(_ context.Context, c cloud.Credentials) (cloud.Identity, error)
- func (f *Fake) IdentityCalls(c cloud.Credentials) int
- func (f *Fake) OutOfReach(c cloud.Credentials)
- func (f *Fake) Profile(_ context.Context, name config.ProfileName) (cloud.Profile, bool, error)
- func (f *Fake) ProfileCalls(name config.ProfileName) int
- func (f *Fake) SetIdentity(id cloud.Identity)
- func (f *Fake) SetProfile(p cloud.Profile)
- func (f *Fake) SetSignIn(name config.ProfileName, start func() (cloud.DeviceSignIn, error))
- func (f *Fake) SetWriteAccess(a cloud.WriteAccess)
- func (f *Fake) SignInCalls(name config.ProfileName) int
- func (f *Fake) SignOut(c cloud.Credentials)
- func (f *Fake) StartSignIn(_ context.Context, name config.ProfileName) (cloud.DeviceSignIn, error)
- func (f *Fake) WriteAccess(_ context.Context, q cloud.WriteAccessQuery) (cloud.WriteAccess, error)
- func (f *Fake) WriteAccessCalls(a account.ID) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake answers from what its test set, failing as a driver does: credentials it holds no identity for are cloud.ErrNoProfile, signed-out credentials and an environment emptied of them are a *cloud.SignedOutError, and the write-access check of an account the credentials aren't in is a *cloud.AccountMismatchError. An account it holds no write-access answer for is unknown, as a driver answers what it couldn't read whole. Its methods are safe to call from several goroutines.
func (*Fake) EmptyEnvironment ¶
func (f *Fake) EmptyEnvironment()
EmptyEnvironment makes the environment hold no credentials at all, as one does where the AWS SDK's chain finds none.
func (*Fake) IdentityCalls ¶
func (f *Fake) IdentityCalls(c cloud.Credentials) int
IdentityCalls counts the calls of Identity with c.
func (*Fake) OutOfReach ¶
func (f *Fake) OutOfReach(c cloud.Credentials)
OutOfReach makes every question asked with c fail with cloud.ErrOutOfReach, wrapped.
func (*Fake) ProfileCalls ¶
func (f *Fake) ProfileCalls(name config.ProfileName) int
ProfileCalls counts the calls of Profile for name.
func (*Fake) SetIdentity ¶
SetIdentity signs id.Credentials in as id. An id with no fingerprint gets one of its credentials, account and ARN.
func (*Fake) SetProfile ¶
SetProfile makes p a profile of the AWS config.
func (*Fake) SetSignIn ¶
func (f *Fake) SetSignIn(name config.ProfileName, start func() (cloud.DeviceSignIn, error))
SetSignIn has each device sign-in started for the profile named be what start gives.
func (*Fake) SetWriteAccess ¶
func (f *Fake) SetWriteAccess(a cloud.WriteAccess)
SetWriteAccess makes a the answer for a.Account.
func (*Fake) SignInCalls ¶
func (f *Fake) SignInCalls(name config.ProfileName) int
SignInCalls is how many device sign-ins were started for the profile named.
func (*Fake) SignOut ¶
func (f *Fake) SignOut(c cloud.Credentials)
SignOut makes c's sign-in expired. Its error gives the login command of the profile set with SetProfile, none where there's none.
func (*Fake) StartSignIn ¶
func (f *Fake) StartSignIn(_ context.Context, name config.ProfileName) (cloud.DeviceSignIn, error)
StartSignIn is the device sign-in set for the profile named with SetSignIn, and cloud.ErrNoDeviceSignIn, wrapped, where none is.
func (*Fake) WriteAccess ¶
func (f *Fake) WriteAccess(_ context.Context, q cloud.WriteAccessQuery) (cloud.WriteAccess, error)
WriteAccess is the answer set for q.Account, once q.Credentials are signed in there.