Documentation
¶
Index ¶
- func ValidateConfig(i *InstanceConfig, config *config.StorkConfig) bool
- type AWSClient
- func (s *AWSClient) CreateBucket(name string) error
- func (s *AWSClient) DeleteBucket(name string) error
- func (s *AWSClient) DescribeInstanceStatus(instanceIDs []string) ([]InstanceStatus, error)
- func (s *AWSClient) StartInstances(n int64, iConfig *InstanceConfig) ([]string, error)
- func (s *AWSClient) TerminateInstances(instanceIDs []string) error
- type EC2Mock
- func (e *EC2Mock) CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
- func (e *EC2Mock) DescribeInstanceStatus(*ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error)
- func (e *EC2Mock) RunInstances(*ec2.RunInstancesInput) (*ec2.Reservation, error)
- func (e *EC2Mock) TerminateInstances(*ec2.TerminateInstancesInput) (*ec2.TerminateInstancesOutput, error)
- type InstanceConfig
- type InstanceStatus
- type S3Mock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateConfig ¶
func ValidateConfig(i *InstanceConfig, config *config.StorkConfig) bool
ValidateConfig ensures that InstanceConfig is complete and can safely be sent to a Synthea instance without error.
Types ¶
type AWSClient ¶
type AWSClient struct { Config *config.StorkConfig Session *session.Session S3 s3iface.S3API EC2 ec2iface.EC2API }
AWSClient contains the initialized clients and interfaces needed for Stork to interact with AWS.
func NewAWSClient ¶
func NewAWSClient(config *config.StorkConfig) *AWSClient
NewAWSClient returns a pointer to an initialized AWSClient
func (*AWSClient) CreateBucket ¶
CreateBucket creates a new S3 bucket with a given name
func (*AWSClient) DeleteBucket ¶
DeleteBucket deletes an existing S3 bucket and its contents, by name
func (*AWSClient) DescribeInstanceStatus ¶
func (s *AWSClient) DescribeInstanceStatus(instanceIDs []string) ([]InstanceStatus, error)
DescribeInstanceStatus returns the status of one or more Synthea instances. The status returned from ec2.DescribeInstanceStatus is converted to a local representation of status.
func (*AWSClient) StartInstances ¶
func (s *AWSClient) StartInstances(n int64, iConfig *InstanceConfig) ([]string, error)
StartInstances starts n new Synthea instances with the same configuration. All instances are expected to share an equal compute load, with a minimum of 500 patients each (this is validated elsewhere).
func (*AWSClient) TerminateInstances ¶
TerminateInstances terminates one or more Synthea instances. This may be called after the /done endpoint is pinged, or if an abort request is made.
type EC2Mock ¶
EC2Mock mocks out the AWS EC2 API for testing
func NewEC2Mock ¶
func NewEC2Mock() *EC2Mock
NewEC2Mock returns a pointer to an initialized EC2 mock
func (*EC2Mock) CreateTags ¶
func (e *EC2Mock) CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
CreateTags mocks the ec2.createTags operation
func (*EC2Mock) DescribeInstanceStatus ¶
func (e *EC2Mock) DescribeInstanceStatus(*ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error)
DescribeInstanceStatus mocks the ec2.describeInstanceStatus operation
func (*EC2Mock) RunInstances ¶
func (e *EC2Mock) RunInstances(*ec2.RunInstancesInput) (*ec2.Reservation, error)
RunInstances mocks the ec2.runInstances operation
func (*EC2Mock) TerminateInstances ¶
func (e *EC2Mock) TerminateInstances(*ec2.TerminateInstancesInput) (*ec2.TerminateInstancesOutput, error)
TerminateInstances mocks the ec2.terminateInstances operation
type InstanceConfig ¶
type InstanceConfig struct { TaskID string `json:"task_id"` Population int `json:"population"` BucketName string `json:"bucketName"` BucketRegion string `json:"bucketRegion"` // The endpoint Synthea should ping when done generating patients DoneEndpoint string `json:"done_endpoint"` }
InstanceConfig describes the configuration that will be passed to each Synthea instance as serialized JSON (in user data).
type InstanceStatus ¶
InstanceStatus describes the current status of a running Synthea instance.
type S3Mock ¶
S3Mock mocks out the AWS S3 API for testing
func (*S3Mock) CreateBucket ¶
func (s *S3Mock) CreateBucket(in *s3.CreateBucketInput) (*s3.CreateBucketOutput, error)
CreateBucket mocks the s3.createBucket operation
func (*S3Mock) DeleteBucket ¶
func (s *S3Mock) DeleteBucket(in *s3.DeleteBucketInput) (*s3.DeleteBucketOutput, error)
DeleteBucket mocks the s3.deleteBucket operation