Documentation
¶
Index ¶
- Constants
- Variables
- func Call(args ...string) ([]byte, error)
- func CallSilent(args ...string) ([]byte, error)
- func CreateBucket(bktName string, opt ...Option) error
- func CreateBucketAt(bktName string, region string, opt ...Option) error
- func DeleteBucket(bktName string) error
- func DeleteBucketAt(bktName string, region string) error
- func InUse() bool
- func IsBucketNameValid(b string) bool
- func IsExist(objectPath string) bool
- func IsRunning() bool
- func PutObject(objectPath string, source string) error
- func Use() error
- func UseNot() error
- type Option
Constants ¶
const ( // DefaultRegion is the default region used by localstack. DefaultRegion = "us-west-2" // Endpoint is the localstack endpoint. Endpoint = "http://localhost:4566" // Env is the environment variable name for the localstack use. If set, the aws // library uses the localstack emulator. The preferred way to set this variable is to use // `localstack.Use()` and `localstack.UseNot()`. Env = config.Env )
Variables ¶
var ErrInvalidBucketName = errors.New("invalid bucket name")
ErrInvalidBucketName is returned when the bucket name is invalid.
Functions ¶
func CallSilent ¶
CallSilent is the equivalent to call `awslocal` from the command line.
func CreateBucket ¶
CreateBucket creates the bucket `bktName` on the localstack. For testing purpose exclusively. It supports the option WithNoErrorIfExist.
func CreateBucketAt ¶
CreateBucketAt creates the bucket `bktName` on the localstack in the AWS region. For testing purpose exclusively. It supports the option WithNoErrorIfExist.
func DeleteBucket ¶
DeleteBucket deletes the bucket `bktName` on the localstack.
func DeleteBucketAt ¶
DeleteBucketAt deletes the bucket `bktName` on the localstack. The bucket does not need to be empty.
func InUse ¶
func InUse() bool
InUse returns true if the application uses the localstack emulator. LocalStack may run but not used by the application.
func IsBucketNameValid ¶
IsBucketNameValid returns true if the bucket name is syntactically valid.
Types ¶
type Option ¶
type Option func(opts *options)
Option allows parameterizing function
func WithEnvironmentVariable ¶
WithEnvironmentVariable allows to set environment variables
func WithNoErrorIfExist ¶
func WithNoErrorIfExist() Option
WithNoErrorIfExist filters out the error if the bucket to be created already exists.