Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) Cleanup(ctx context.Context) error
- func (c *Cluster) Context(ctx context.Context) *Cluster
- func (c *Cluster) NewNode(ctx context.Context) (clusteriface.Node, error)
- func (c *Cluster) NewNodes(ctx context.Context, n int) (clusteriface.Nodes, error)
- func (c *Cluster) WithAMIID(amiID string) *Cluster
- func (c *Cluster) WithCleanupWait() *Cluster
- func (c *Cluster) WithInstanceType(s string) *Cluster
- func (c *Cluster) WithLogger(l *zap.SugaredLogger) *Cluster
- func (c *Cluster) WithNodeAgentBin(binPath string) *Cluster
- func (c *Cluster) WithRunInstancesInput(f func(input *ec2.RunInstancesInput) error) *Cluster
- func (c *Cluster) WithSession(sess *session.Session) *Cluster
- type Node
- func (n *Node) Dial(ctx context.Context, network, addr string) (net.Conn, error)
- func (n *Node) Fetch(ctx context.Context, url, path string) error
- func (n *Node) Heartbeat(ctx context.Context) error
- func (n *Node) ReadFile(ctx context.Context, path string) (io.ReadCloser, error)
- func (n *Node) SendFile(ctx context.Context, filePath string, contents io.Reader) error
- func (n *Node) StartProc(ctx context.Context, req clusteriface.StartProcRequest) (clusteriface.Process, error)
- func (n *Node) Stop(ctx context.Context) error
- func (n *Node) String() string
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Nodes []*Node InstanceType string CleanupWait bool RunInstancesConfig func(*ec2.RunInstancesInput) error // contains filtered or unexported fields }
func NewCluster ¶
func NewCluster() *Cluster
NewCluster creates a new AWS cluster. This uses standard AWS profile env vars. With no configuration, this uses the default profile. The user/role used must have the appropriate permissions for the test runner, in order to find the resources in the account and launch/destroy EC2 instances.
By default, this looks for the node agent binary by searching up from PWD for a "nodeagent" file.
func (*Cluster) WithCleanupWait ¶
WithCleanupWait causes the Cleanup methods to wait for instance termination to succeed before returning.
func (*Cluster) WithInstanceType ¶
func (*Cluster) WithLogger ¶
func (c *Cluster) WithLogger(l *zap.SugaredLogger) *Cluster
func (*Cluster) WithNodeAgentBin ¶
func (*Cluster) WithRunInstancesInput ¶
func (c *Cluster) WithRunInstancesInput(f func(input *ec2.RunInstancesInput) error) *Cluster
WithRunInstancesInput registers a callback for customizing RunInstances calls when new nodes are created.
Click to show internal directories.
Click to hide internal directories.