s3util

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package s3util defines some helpful utilities for working with S3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketRegion

func BucketRegion(ctx context.Context, bucket string) (string, error)

BucketRegion reports the specified region for the given bucket using the GetBucketLocation API.

func IsNotExist

func IsNotExist(err error) bool

IsNotExist reports whether err is an error indicating the requested resource was not found, taking into account S3 and standard library types.

Types

type ETagReader

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

ETagReader implements the io.Reader interface by delegating to a nested reader. The ETag method returns a correctly-formatted S3 ETag for all the data that have been read so far (initially none).

func NewETagReader

func NewETagReader(r io.Reader) ETagReader

NewETagReader returns a new S3 ETag reader for the contents of r.

func (ETagReader) ETag

func (e ETagReader) ETag() string

ETag returns a correctly-formatted S3 etag for the contents of e that have been read so far.

func (ETagReader) Read

func (e ETagReader) Read(data []byte) (int, error)

Read satisfies io.Reader by delegating to the wrapped reader.

Jump to

Keyboard shortcuts

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