objectstorage

package
v0.0.0-...-63027bd Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: AGPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GuildBucket

func GuildBucket(guildId string) string

Returns the name of the bucket for the given guild

Types

type ObjectStorage

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

A simple abstraction for object storage

func New

func (*ObjectStorage) Delete

func (o *ObjectStorage) Delete(ctx context.Context, bucketName, dir, filename string) error

Deletes a file

func (*ObjectStorage) GetUrl

func (o *ObjectStorage) GetUrl(ctx context.Context, bucketName, dir, filename string, urlExpiry time.Duration, internal bool) (*url.URL, error)

Returns the url to the file

func (*ObjectStorage) Save

func (o *ObjectStorage) Save(ctx context.Context, bucketName, dir, filename string, data *bytes.Buffer, expiry time.Duration) error

Saves a file to the object storage

Note that 'expiry' is not supported for local storage

Jump to

Keyboard shortcuts

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