Documentation ¶
Overview ¶
The ec2test package implements a fake EC2 provider with the capability of inducing errors on any given operation, and retrospectively determining what operations have been carried out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Pending = ec2.InstanceState{0, "pending"} Running = ec2.InstanceState{16, "running"} ShuttingDown = ec2.InstanceState{32, "shutting-down"} Terminated = ec2.InstanceState{16, "terminated"} Stopped = ec2.InstanceState{16, "stopped"} )
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { RequestId string // Request holds the requested action as a url.Values instance Request url.Values // If the action succeeded, Response holds the value that // was marshalled to build the XML response for the request. Response interface{} // If the action failed, Err holds an error giving details of the failure. Err *ec2.Error }
Action represents a request that changes the ec2 state.
type Instance ¶
type Instance struct { // UserData holds the data that was passed to the RunInstances request // when the instance was started. UserData []byte // contains filtered or unexported fields }
instance holds a simulated ec2 instance
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements an EC2 simulator for use in testing.
func (*Server) Instance ¶
Instance returns the instance for the given instance id. It returns nil if there is no such instance.
func (*Server) NewInstances ¶
func (srv *Server) NewInstances(n int, instType string, imageId string, state ec2.InstanceState, groups []ec2.SecurityGroup) []string
NewInstances creates n new instances in srv with the given instance type, image ID, initial state and security groups. If any group does not already exist, it will be created. NewInstances returns the ids of the new instances.
func (*Server) SetInitialInstanceState ¶
func (srv *Server) SetInitialInstanceState(state ec2.InstanceState)
SetInitialInstanceState sets the state that any new instances will be started in.