s3

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBucket

func CreateBucket(bucket string) error

CreateBucket creates new bucket in S3 store

func DeleteBucket

func DeleteBucket(bucket string) error

DeleteBucket deletes bucket in S3 store

func DeleteObject

func DeleteObject(bucket, objectName, versionId string) error

DeleteObject deletes object from S3 storage

func GetObject

func GetObject(bucket, objectName string) ([]byte, error)

GetObjects returns given object from S3 storage

func Init added in v0.5.8

func Init()

Init function initializes S3 backend storage

func UploadObject

func UploadObject(bucket, objectName, contentType string, reader io.Reader, size int64) error

UploadObject uploads given object to S3 store

Types

type BucketInfo added in v0.5.7

type BucketInfo struct {
	Name         string    `json:"name"`
	CreationDate time.Time `json:"creation_date"`
}

BucketInfo provides information about S3 bucket

func ListBuckets

func ListBuckets() ([]BucketInfo, error)

ListBuckets provides list of buckets in S3 store

type BucketObject

type BucketObject struct {
	Bucket  string       `json:"bucket"`
	Objects []ObjectInfo `json:"objects"`
}

BucketObject represents S3 bucket object

func BucketContent

func BucketContent(bucket string) (BucketObject, error)

BucketContent provides content on given bucket

type MinioBucketObject added in v0.5.7

type MinioBucketObject struct {
	Bucket  string             `json:"bucket"`
	Objects []minio.ObjectInfo `json:"objects"`
}

MinioBucketObject represents s3 object

type ObjectInfo added in v0.5.7

type ObjectInfo struct {
	Name         string    `json:"name"`          // Name of the object
	LastModified time.Time `json:"last_modified"` // Date and time the object was last modified.
	Size         int64     `json:"size"`          // Size in bytes of the object.
	ContentType  string    `json:"content_type"`  // A standard MIME type describing the format of the object data.
	Expires      time.Time `json:"expires"`       // The date and time at which the object is no longer able to be cached.
}

ObjectInfo provides information about S3 object

func ListObjects

func ListObjects(bucket string) ([]ObjectInfo, error)

ListObjects provides list of buckets in S3 store

type S3

type S3 struct {
	Endpoint     string
	AccessKey    string
	AccessSecret string
	UseSSL       bool
}

S3 represent S3 storage record

Jump to

Keyboard shortcuts

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