factory

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFunc

func NewFunc(config interface{}, dependencies factory.Dependencies, out interface{}) error

NewFunc is the factory creation function for the EC2 Machines implementation.

Types

type Config

type Config struct {
	// Region is the region the EC2 component will operate in.
	Region string `validate:"required"`
	// Limit is the maximum number of EC2 instances that this component has available.
	// If set to -1, it will not limit the number of instances. Note that the component will still be subject to EC2
	// instance availability.
	Limit *int64
	// WorkerGroupName is the label value set on all machines created by this component. It is used to identify
	// machines created by this component.
	WorkerGroupName string
	// Zones contains the set of availability zones the machines component will launch simulation instances in.
	Zones []ec2.Zone `validate:"required"`
}

Config is used to create an EC2 machines component.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates that the config values are valid.

type Dependencies

type Dependencies struct {
	// Logger is used to store log information.
	Logger gz.Logger `validate:"required"`
	// API is the EC2 API client used to interface with AWS EC2 in a single region.
	// If API is not provided, it will be initialized using Config values.
	API ec2iface.EC2API
	// PricingAPI is the Pricing API client used to interface with AWS Pricing API.
	// If PricingAPI is not provided, it will be initialized using Config values.
	PricingAPI *pricing.Pricing
}

Dependencies is used to create an EC2 machines component.

func (*Dependencies) Validate

func (d *Dependencies) Validate() error

Validate validates that the dependencies values are valid.

Jump to

Keyboard shortcuts

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