aws

package
v0.0.0-...-afcb59f Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config) (Client, error)

func (Client) Copy

func (c Client) Copy(ctx context.Context, src, dst blobstorage.UploadableObject) error

func (Client) DeleteFile

func (c Client) DeleteFile(ctx context.Context, object blobstorage.UploadableObject) error

func (Client) FileExists

func (c Client) FileExists(ctx context.Context, object blobstorage.UploadableObject) (bool, error)

func (Client) FindFilesWithName

func (c Client) FindFilesWithName(ctx context.Context, bucketName, prefix, filename string) ([]string, error)

func (Client) GetPublicURL

func (c Client) GetPublicURL(object blobstorage.UploadableObject) string

func (Client) GetSignedURL

func (c Client) GetSignedURL(ctx context.Context, object blobstorage.UploadableObject, options ...blobstorage.Option) (string, error)

func (Client) InitResumableUpload

func (c Client) InitResumableUpload(ctx context.Context, object storage.UploadableObject) (*storage.ResumableUploadResponse, error)

func (Client) ReadFile

func (c Client) ReadFile(ctx context.Context, object blobstorage.UploadableObject) (io.ReadCloser, error)

func (Client) SanitizeFilename

func (c Client) SanitizeFilename(filename string, timestamp int64) string

func (Client) UploadFile

func (c Client) UploadFile(ctx context.Context, object storage.UploadableObject, fileReader io.Reader) (string, error)

type Config

type Config struct {
	BucketName      string
	AccessKeyID     string
	SecretAccessKey string
	Region          string
	Endpoint        string
}

type DefaultPrivateUploadable

type DefaultPrivateUploadable struct {
	DefaultPublicUploadable
}

func PrivateUploadable

func PrivateUploadable(fileLocation string) DefaultPrivateUploadable

func (DefaultPrivateUploadable) GetBucketName

func (p DefaultPrivateUploadable) GetBucketName() string

type DefaultPublicUploadable

type DefaultPublicUploadable struct {
	Path string
}

func PublicUploadable

func PublicUploadable(fileLocation string) DefaultPublicUploadable

func (DefaultPublicUploadable) GetBucketName

func (p DefaultPublicUploadable) GetBucketName() string

func (DefaultPublicUploadable) GetFileLocation

func (p DefaultPublicUploadable) GetFileLocation() string

func (DefaultPublicUploadable) GetTimestamp

func (p DefaultPublicUploadable) GetTimestamp() int64

Jump to

Keyboard shortcuts

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