s3

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package s3 is the object-store backend for payload logging: one JSON object per Record. S3-compatible via minio-go, so it targets AWS S3, MinIO, and other compatible stores with the same client. Implements payload.Sink.

This package pulls in the minio-go SDK. It is excluded from the relay "minimal" build (see cmd/relay's build-tagged sink seam), so a minimal binary/image carries none of these deps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint  string // host:port (no scheme), e.g. "s3.amazonaws.com" or "minio.dev-stack:9000"
	Bucket    string
	Region    string // optional; AWS uses it, MinIO ignores it
	AccessKey string
	SecretKey string
	Prefix    string // key prefix, e.g. "payloads"; trailing slash optional
	UseSSL    bool
}

Config holds the object-store connection + placement settings.

type Reader

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

Reader is a payload.Reader over the object layout the Sink writes (<prefix>/YYYY/MM/DD/<request_id>.json). Get locates a single object by request-id suffix. There is no List — the Logs list is served by the log store, not the body store.

func NewReader

func NewReader(ctx context.Context, cfg Config) (*Reader, error)

NewReader constructs a Reader against the same bucket/prefix the Sink targets. It verifies the bucket is reachable.

func (*Reader) Get

func (r *Reader) Get(ctx context.Context, requestID string) (payload.Record, error)

Get fetches the object whose key ends with /<requestID>.json. Without a timestamp the date partition is unknown, so it scans recursively under the prefix and stops at the first match. Returns payload.ErrNotFound if absent.

type Sink

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

Sink writes each Record as an object at <prefix>/<YYYY>/<MM>/<DD>/<request_id>.json. PutObject is synchronous per call; the emitter's single drain goroutine serializes writes and drop-on-full upstream protects the hot path.

func New

func New(ctx context.Context, cfg Config) (*Sink, error)

New constructs the sink and verifies the bucket is reachable.

func (*Sink) Write

func (s *Sink) Write(r payload.Record) error

Jump to

Keyboard shortcuts

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