cloudtest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cloudtest is a cloud.Cloud a test programs, which counts what it's asked. Only tests import it.

Index

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 New

func New() *Fake

New is a Fake that knows nothing yet.

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) Identity

func (f *Fake) Identity(_ context.Context, c cloud.Credentials) (cloud.Identity, error)

Identity is the identity set for c.

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) Profile

func (f *Fake) Profile(_ context.Context, name config.ProfileName) (cloud.Profile, bool, error)

Profile is the profile set with SetProfile.

func (*Fake) ProfileCalls

func (f *Fake) ProfileCalls(name config.ProfileName) int

ProfileCalls counts the calls of Profile for name.

func (*Fake) SetIdentity

func (f *Fake) SetIdentity(id cloud.Identity)

SetIdentity signs id.Credentials in as id. An id with no fingerprint gets one of its credentials, account and ARN.

func (*Fake) SetProfile

func (f *Fake) SetProfile(p cloud.Profile)

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.

func (*Fake) WriteAccessCalls

func (f *Fake) WriteAccessCalls(a account.ID) int

WriteAccessCalls counts the calls of WriteAccess for account.

Jump to

Keyboard shortcuts

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