s3

package
v0.0.0-...-d0fd1eb Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidFileTypes = []string{"7z", "abc", "accdb", "apk", "bat", "bin", "bz2", "bzip2", "c", "c#", "cab", "cc", "cer", "cpp", "csv", "cxx", "dbf", "dbx", "deb", "dmg", "doc", "docx", "dot", "dotx", "dwg", "dxf", "eml", "emlx", "exe", "gpg", "gz", "gzip", "html", "iwa", "jar", "java", "json", "key", "keynote", "lua", "mdb", "msg", "msi", "odp", "oos", "p12", "pages", "pdf", "perl", "pgp", "pl", "pot", "pps", "ppt", "pptx", "pst", "py", "rar", "rtf", "sdp", "sdw", "sldasm", "slddrw", "sldprt", "sql", "sxi", "sxw", "tar.gz", "tsv", "txt", "vdx", "vsd", "vss", "vst", "vsx", "vtw", "vtx", "xls", "xlsx", "xlw", "xml", "xps", "zip"}

var ValidFileTypes = []string{"json", "yaml", "yml", "log", "tfstate", "csv"}

Functions

func CheckPublicBucket

func CheckPublicBucket(bucketName string, sess *session.Session) (bool, error)

Will return true if the bucket is public

func GetBucketEncryption

func GetBucketEncryption(sess *session.Session, name string) (string, error)

GetBucketEncryption will return the encryption type, if enabled, for the specified bucket There should only ever be one encrypt type applied, even though the rules is a slice

func GetBucketNames

func GetBucketNames(sess *session.Session, name string) ([]string, error)

GetAllBucketNames will return all of the bucket names for the listed account Can filter down the names with the "name" parameter if desired

func GetBucketRegion

func GetBucketRegion(sess *session.Session, bucketName string) (string, error)

func GoCopyObject

func GoCopyObject(sess *session.Session, input CopyObjectStruct) error

func GoGetObject

func GoGetObject(sess *session.Session, input GetObjectStruct) (io.ReadCloser, error)

func GoPutObject

func GoPutObject(sess *session.Session, input PutObjectStruct) error

func WriteProfilesBuckets

func WriteProfilesBuckets(profileBuckets ProfilesBuckets) error

func WriteProfilesBucketsFileSize

func WriteProfilesBucketsFileSize(profilesBuckets []*BucketSizeInfo) error

Types

type AccountBuckets

type AccountBuckets []BucketInfo

type BucketInfo

type BucketInfo struct {
	Name       string `yaml:"name"`
	Profile    string `yaml:"profile"`
	AccountId  string
	Encryption string `yaml:"encrypted"`
	Region     string `yaml:"region"`
}

func GetProfileBuckets

func GetProfileBuckets(account utils.AccountInfo, name string) ([]BucketInfo, error)

name is an optional parameter for searching the buckets for a name

type BucketSizeInfo

type BucketSizeInfo struct {
	BucketInfo  BucketInfo
	FileTypes   []FileType
	ObjectCount int
	TotalSize   int64
}

func GetBucketFileSize

func GetBucketFileSize(bucket BucketInfo, sess *session.Session) (*BucketSizeInfo, error)

func GetProfileBucketsFileSize

func GetProfileBucketsFileSize(buckets []BucketInfo, account utils.AccountInfo) ([]*BucketSizeInfo, error)

func GetProfilesPublicBucketsFileSize

func GetProfilesPublicBucketsFileSize(accounts []utils.AccountInfo, bucketOption string) ([]*BucketSizeInfo, error)

type CopyObjectStruct

type CopyObjectStruct struct {
	Bucket     string
	CopySource string
	Key        string
}

type FileType

type FileType struct {
	Type string
	Size int64
}

type GetObjectStruct

type GetObjectStruct struct {
	Bucket string
	Key    string
}

type ProfilesBuckets

type ProfilesBuckets []AccountBuckets

func GetProfilesBuckets

func GetProfilesBuckets(accounts []utils.AccountInfo) (ProfilesBuckets, error)

type PutObjectStruct

type PutObjectStruct struct {
	Body   []byte
	Bucket string
	Key    string
}

Jump to

Keyboard shortcuts

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