aws

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrCodeKMSThrottlingException is defined in the API Reference
	// https://docs.aws.amazon.com/sdk-for-go/api/service/kinesis/#Kinesis.GetRecords
	ErrCodeKMSThrottlingException = "KMSThrottlingException"
)

Variables

View Source
var (
	ErrLeaseNotAcquired = errors.New("the shard could not be leased due to a collision")
)

Common errors that might occur throughout checkpointing.

Functions

func GetLocalStack added in v1.6.0

func GetLocalStack(t testing.TB, envVars []string, readyFns ...func(port string) error) (port string)

TODO: Add config + options pattern or use an already existing library like https://github.com/elgohr/go-localstack

func GetSession

func GetSession(ctx context.Context, parsedConf *service.ParsedConfig, opts ...func(*config.LoadOptions) error) (aws.Config, error)

Types

type S3StreamWriterStats added in v1.16.0

type S3StreamWriterStats struct {
	TotalMessages int64
	TotalBytes    int64
	PartsUploaded int32
	Age           time.Duration
	LastWriteAge  time.Duration
}

WriterStats contains statistics about the writer

type S3StreamingWriter added in v1.16.0

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

S3StreamingWriter writes content incrementally to S3 using multipart uploads. It buffers bytes and uploads parts as they reach the S3 minimum part size (5MB).

func NewS3StreamingWriter added in v1.16.0

func NewS3StreamingWriter(config S3StreamingWriterConfig) (*S3StreamingWriter, error)

NewS3StreamingWriter creates a new streaming S3 writer

func (*S3StreamingWriter) Close added in v1.16.0

func (w *S3StreamingWriter) Close(ctx context.Context) error

Close finalizes the file by flushing remaining data and completing the upload

func (*S3StreamingWriter) Initialize added in v1.16.0

func (w *S3StreamingWriter) Initialize(ctx context.Context) error

Initialize starts the S3 multipart upload

func (*S3StreamingWriter) Stats added in v1.16.0

Stats returns current writer statistics

func (*S3StreamingWriter) WriteBytes added in v1.16.0

func (w *S3StreamingWriter) WriteBytes(ctx context.Context, data []byte) error

WriteBytes adds bytes to the buffer and flushes when thresholds are reached

type S3StreamingWriterConfig added in v1.16.0

type S3StreamingWriterConfig struct {
	S3Client        s3StreamingAPI
	Bucket          string
	Key             string
	MaxBufferBytes  int64         // Maximum bytes to buffer before flushing (default: 10MB)
	MaxBufferCount  int           // Maximum messages to buffer before flushing (default: 10000)
	MaxBufferPeriod time.Duration // Maximum time to buffer before flushing (default: 10s)
	ContentType     string        // Content type for S3 object
	ContentEncoding string        // Content encoding for S3 object (optional)
	BackoffCtor     func() backoff.BackOff
}

S3StreamingWriterConfig contains configuration for creating an S3StreamingWriter

type WaitForSpaceResult added in v1.16.0

type WaitForSpaceResult int

WaitForSpaceResult indicates the outcome of WaitForSpace.

const (
	// WaitForSpaceOK indicates space is available.
	WaitForSpaceOK WaitForSpaceResult = iota
	// WaitForSpaceCancelled indicates the context was cancelled.
	WaitForSpaceCancelled
	// WaitForSpaceTimeout indicates the timeout was reached while waiting.
	WaitForSpaceTimeout
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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