s3

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRegion = "eu-west-1"
View Source
const DefaultRequestTimeout = 1 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Ctx       context.Context
	Host      string
	Port      uint16
	AccessKey string
	SecretKey string
	TLS       bool
	ChunkSize int
	// contains filtered or unexported fields
}

func NewS3Client

func NewS3Client(
	ctx context.Context,
	host string,
	port uint16,
	accessKey string,
	secretKey string,
	tls bool,
	chunkSize int,
) *Client

func (*Client) CreateBucket

func (c *Client) CreateBucket(bucket string) (int, error)

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(bucket string) (int, error)

func (*Client) DeleteObject

func (c *Client) DeleteObject(bucket, key string) (int, error)

func (*Client) DeleteObjects

func (c *Client) DeleteObjects(bucket string, keys ...string) (*serverTypes.DeleteResult, int, error)

func (*Client) DoSigV4Request

func (c *Client) DoSigV4Request(method, rawURL string, body io.ReadCloser) (*http.Response, error)

func (*Client) GetObject

func (c *Client) GetObject(bucket, key string, writer io.Writer, progressCh chan<- types.Progress) (int, error)

func (*Client) HeadBucket

func (c *Client) HeadBucket(bucket string) (int, error)

func (*Client) HeadObject

func (c *Client) HeadObject(bucket, key string) (*HeadObjectResponse, error)

func (*Client) IsDone

func (c *Client) IsDone() bool

func (*Client) ListBuckets

func (c *Client) ListBuckets() ([]types.Bucket, error)

func (*Client) ListObjects

func (c *Client) ListObjects(bucket, key string, useV2 bool) <-chan ListResult

func (*Client) PutObject

func (c *Client) PutObject(bucket, key string, file *os.File, progressCh chan<- types.Progress) (int, error)

type HeadObjectResponse

type HeadObjectResponse struct {
	ContentType   string
	ContentLength int64
	LastModified  time.Time
	StatusCode    int
}

type ListResult

type ListResult struct {
	Object       *types.Object
	CommonPrefix *types.CommonPrefix
	Err          error
}

func (*ListResult) IsCommonPrefix

func (lr *ListResult) IsCommonPrefix() bool

func (*ListResult) IsObject

func (lr *ListResult) IsObject() bool

type SigV4ChunkEncoder

type SigV4ChunkEncoder struct {
	Ctx       context.Context
	Src       io.ReadCloser
	DataSize  int
	TotalSize int
	ChunkSize int
	// contains filtered or unexported fields
}

func NewSigV4ChunkEncoder

func NewSigV4ChunkEncoder(
	ctx context.Context,
	src io.ReadCloser,
	dataSize int,
	chunkSize int,
	progressCh chan<- client.Progress,
) *SigV4ChunkEncoder

func (*SigV4ChunkEncoder) Close

func (enc *SigV4ChunkEncoder) Close() error

func (*SigV4ChunkEncoder) Read

func (enc *SigV4ChunkEncoder) Read(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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