s3

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 13 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(endpoint, accessKeyId, secretAccessKey, region, bucket string, useSSL bool) (*Client, error)

NewClient creates S3 client

func (*Client) ListObjectsPrefix added in v1.5.0

func (c *Client) ListObjectsPrefix(ctx context.Context, prefix string, max int64) ([]ObjectInfo, error)

ListObjectsPrefix lists object keys under a given prefix

func (*Client) MakeDownloadURL added in v1.7.0

func (c *Client) MakeDownloadURL(ctx context.Context, key string, ttl time.Duration) (string, error)

func (*Client) MakeUploadAttachment

func (c *Client) MakeUploadAttachment(ctx context.Context, channelId, objectId, fileSize int64, objectName string) (string, error)

MakeUploadAttachment returns a presigned PUT URL to upload the object with one-minute duration.

func (*Client) RemoveAttachment

func (c *Client) RemoveAttachment(ctx context.Context, key string) error

func (*Client) StatObject added in v1.5.0

func (c *Client) StatObject(ctx context.Context, key string) (int64, *string, error)

StatObject performs a HEAD request to retrieve object size and content type

func (*Client) UploadObject added in v1.5.0

func (c *Client) UploadObject(ctx context.Context, key string, body io.Reader, contentType string) (err error)

UploadObject uploads an object from a stream to S3 without requiring local disk.

type ObjectInfo added in v1.5.0

type ObjectInfo struct {
	Key  string
	Size int64
}

ObjectInfo contains minimal info returned from listing

Jump to

Keyboard shortcuts

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