Documentation ¶
Index ¶
- Variables
- type Instance
- type InstanceOption
- func WithClientFromEnv() (InstanceOption, error)
- func WithClientFromEnvCtx(ctx context.Context) (InstanceOption, error)
- func WithLabels(labels map[string]string) InstanceOption
- func WithLogger(logger *logrus.Logger) InstanceOption
- func WithTimeout(timeout time.Duration) InstanceOption
- func WithVersion(version string) InstanceOption
- type Service
Constants ¶
This section is empty.
Variables ¶
var ( FixedPort = Service{Name: "all", Port: "4566/tcp"} CloudFormation = Service{Name: "cloudformation", Port: "4581/tcp"} CloudWatch = Service{Name: "cloudwatch", Port: "4582/tcp"} CloudWatchLogs = Service{Name: "cloudwatchlogs", Port: "4586/tcp"} CloudWatchEvents = Service{Name: "cloudwatchevents", Port: "4587/tcp"} DynamoDB = Service{Name: "dynamoDB", Port: "4569/tcp"} DynamoDBStreams = Service{Name: "dynamoDBStreams", Port: "4570/tcp"} EC2 = Service{Name: "ec2", Port: "4597/tcp"} ES = Service{Name: "es", Port: "4578/tcp"} Firehose = Service{Name: "firehose", Port: "4573/tcp"} IAM = Service{Name: "iam", Port: "4593/tcp"} Kinesis = Service{Name: "kinesis", Port: "4568/tcp"} Lambda = Service{Name: "lambda", Port: "4574/tcp"} Redshift = Service{Name: "redshift", Port: "4577/tcp"} Route53 = Service{Name: "route53", Port: "4580/tcp"} S3 = Service{Name: "s3", Port: "4572/tcp"} SecretsManager = Service{Name: "secretsmanager", Port: "4584/tcp"} SES = Service{Name: "ses", Port: "4579/tcp"} SNS = Service{Name: "sns", Port: "4575/tcp"} SQS = Service{Name: "sqs", Port: "4576/tcp"} SSM = Service{Name: "ssm", Port: "4583/tcp"} STS = Service{Name: "sts", Port: "4592/tcp"} StepFunctions = Service{Name: "stepfunctions", Port: "4585/tcp"} )
Supported AWS/localstack services
var AvailableServices = map[Service]struct{}{ FixedPort: {}, CloudFormation: {}, CloudWatch: {}, CloudWatchLogs: {}, CloudWatchEvents: {}, DynamoDB: {}, DynamoDBStreams: {}, EC2: {}, ES: {}, Firehose: {}, IAM: {}, Kinesis: {}, Lambda: {}, Redshift: {}, Route53: {}, S3: {}, SecretsManager: {}, SES: {}, SNS: {}, SQS: {}, SSM: {}, STS: {}, StepFunctions: {}, }
AvailableServices provides a map of all services for faster searches
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance manages the localstack
func NewInstance ¶
func NewInstance(opts ...InstanceOption) (*Instance, error)
NewInstance creates a new Instance Fails when Docker is not reachable
func NewInstanceCtx ¶ added in v1.0.3
func NewInstanceCtx(ctx context.Context, opts ...InstanceOption) (*Instance, error)
NewInstanceCtx is NewInstance, but with Context
func (*Instance) Endpoint ¶
Endpoint returns the endpoint for the given service Endpoints are allocated dynamically (to avoid blocked ports), but are fix after starting the instance
func (*Instance) EndpointV2 ¶
EndpointV2 returns the endpoint for the given service when used by aws-sdk-v2 Endpoints are allocated dynamically (to avoid blocked ports), but are fix after starting the instance
func (*Instance) StartWithContext ¶
StartWithContext starts the localstack and ends it when the context is done. Use it to also start individual services, by default all are started.
type InstanceOption ¶
type InstanceOption func(i *Instance)
InstanceOption is an option that controls the behaviour of localstack.
func WithClientFromEnv ¶
func WithClientFromEnv() (InstanceOption, error)
WithClientFromEnv configures the instance to use a client that respects environment variables.
func WithClientFromEnvCtx ¶ added in v1.0.3
func WithClientFromEnvCtx(ctx context.Context) (InstanceOption, error)
WithClientFromEnvCtx like WithClientFromEnv but with context
func WithLabels ¶
func WithLabels(labels map[string]string) InstanceOption
WithLabels configures the labels that will be applied on the instance.
func WithLogger ¶
func WithLogger(logger *logrus.Logger) InstanceOption
WithLogger configures the instance to use the specified logger.
func WithTimeout ¶
func WithTimeout(timeout time.Duration) InstanceOption
WithTimeout configures the timeout for terminating the localstack instance. This was invented to prevent orphaned containers after panics. The default timeout is set to 5 minutes.
func WithVersion ¶
func WithVersion(version string) InstanceOption
WithVersion configures the instance to use a specific version of localstack. Must be a valid version string or "latest".
Directories ¶
Path | Synopsis |
---|---|
internalfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |