files

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package files lets us quickly store a file on an S3 bucket

Index

Constants

View Source
const (
	ACLPublicRead             = "public-read"
	ACLPrivate                = "private"
	ACLPublicReadWrite        = "public-read-write"
	ACLAuthenticatedRead      = "authenticated-read"
	ACLBucketOwnerRead        = "bucket-owner-read"
	ACLBucketOwnerFullControl = "bucket-owner-full-control"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Endpoint  string
	AccessKey string
	SecretKey string
	Bucket    string
}

func NewClient

func NewClient(endpoint, accessKey, secretKey, bucket string) Client

func (Client) Upload

func (c Client) Upload(ctx context.Context, filename string, size int, contentType, acl string, reader io.Reader) (string, error)

Upload a file to the bucket and return a public URL

Jump to

Keyboard shortcuts

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