awsspec

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Spec

type S3Spec struct {
	Session *session.Session
}

S3Spec contains the AWS session

func New

func New(s *session.Session) S3Spec

New creates a new AWSSpec

func (S3Spec) BucketExists added in v0.12.0

func (s S3Spec) BucketExists(bucket string) (res bool, err error)

BucketExists returns true if the specified S3 bucket exists

func (S3Spec) BucketHasLifecycleRule added in v0.12.1

func (s S3Spec) BucketHasLifecycleRule(bucket string, rule s3.LifecycleRule) (res bool, err error)

BucketHasLifecycleRule returns true if the specified S3 bucket has the provided lifecycle rule. Throws an error if the bucket does not exist.

func (S3Spec) BucketHasLoggingEnabled added in v0.12.0

func (s S3Spec) BucketHasLoggingEnabled(bucket string) (res bool, err error)

BucketHasLoggingEnabled returns true if the specified S3 bucket has logging enabled. Throws an error if the bucket does not exist.

func (S3Spec) BucketHasServerSideEncryption added in v0.12.0

func (s S3Spec) BucketHasServerSideEncryption(bucket, algorithm string) (res bool, err error)

BucketHasServerSideEncryption returns true if the specified S3 bucket has the provided Server Side Encryption method. Throws an error if the bucket does not exist.

func (S3Spec) BucketHasVersioningEnabled added in v0.12.0

func (s S3Spec) BucketHasVersioningEnabled(bucket string) (res bool, err error)

BucketHasVersioningEnabled returns true if the specified S3 bucket has versioning enabled. Throws an error if the bucket does not exist.

func (S3Spec) BucketHasWebsiteEnabled added in v0.12.0

func (s S3Spec) BucketHasWebsiteEnabled(bucket string) (res bool, err error)

BucketHasWebsiteEnabled returns true if the specified S3 bucket is setup as a website. Throws an error if the bucket does not exist.

func (S3Spec) ObjectExists added in v0.13.0

func (s S3Spec) ObjectExists(bucket, key string) (res bool, err error)

ObjectExists returns true if the provided key exists in the specified bucket

func (S3Spec) ObjectHasTag added in v0.12.0

func (s S3Spec) ObjectHasTag(bucket, key string, tag TagGetter) (res bool, err error)

ObjectHasTag verifies that an S3 object has the indicated tag

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag represents an AWS tag

func (Tag) GetKey

func (t Tag) GetKey() string

GetKey retrieves the Tag Key

func (Tag) GetValue

func (t Tag) GetValue() string

GetValue retrieves the Tag Value

type TagGetter

type TagGetter interface {
	GetKey() string
	GetValue() string
}

TagGetter is an interface that wraps the GetKey and GetValue methods

Jump to

Keyboard shortcuts

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