s3

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 9 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) 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.ReadSeeker, contentType string) error

UploadObject uploads an object from a byte stream to S3 at the given key.

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