s3

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

README

s3

import "github.com/agentstation/starmap/pkg/catalogs/storage/s3"

Package s3 provides an S3-compatible implementation of storage.ObjectBackend.

The caller owns the S3 client, including endpoint selection, credentials, retries, transport, and lifecycle. Backend construction performs no network operation. The selected service must implement conditional PutObject writes: If-None-Match for immutable objects and If-Match for pointer promotion.

Index

type Backend

Backend adapts a caller-owned AWS SDK v2 S3 client to ObjectBackend.

Backend does not close or otherwise manage Client. A Backend is safe to share when its Client is safe to share.

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

func New
func New(client *awss3.Client, config Config) (*Backend, error)

New creates an inert S3-compatible object backend.

The caller must configure client with its credentials, region, endpoint, transport, and retry policy before calling New. New performs no network work.

func (*Backend) Get
func (b *Backend) Get(ctx context.Context, key string) (storage.ObjectValue, error)

Get fetches one object and returns its opaque ETag as Version.

func (*Backend) Put
func (b *Backend) Put(ctx context.Context, key string, data []byte, condition storage.ObjectPutCondition) (storage.ObjectValue, error)

Put conditionally writes one object and returns its opaque ETag as Version.

Exactly one condition is required. Backend never performs an unconditional last-writer-wins write.

type Config

Config describes one caller-owned S3 bucket.

type Config struct {
    // Bucket is the S3-compatible bucket that contains catalog objects.
    Bucket string
    // MaxObjectBytes bounds each object read and write. Zero uses
    // resourcepolicy.MaxPayloadBytes.
    MaxObjectBytes int64
}

Generated by gomarkdoc

Documentation

Overview

Package s3 provides an S3-compatible implementation of storage.ObjectBackend.

The caller owns the S3 client, including endpoint selection, credentials, retries, transport, and lifecycle. Backend construction performs no network operation. The selected service must implement conditional PutObject writes: If-None-Match for immutable objects and If-Match for pointer promotion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend adapts a caller-owned AWS SDK v2 S3 client to ObjectBackend.

Backend does not close or otherwise manage Client. A Backend is safe to share when its Client is safe to share.

func New

func New(client *awss3.Client, config Config) (*Backend, error)

New creates an inert S3-compatible object backend.

The caller must configure client with its credentials, region, endpoint, transport, and retry policy before calling New. New performs no network work.

func (*Backend) Get

func (b *Backend) Get(ctx context.Context, key string) (storage.ObjectValue, error)

Get fetches one object and returns its opaque ETag as Version.

func (*Backend) Put

func (b *Backend) Put(
	ctx context.Context,
	key string,
	data []byte,
	condition storage.ObjectPutCondition,
) (storage.ObjectValue, error)

Put conditionally writes one object and returns its opaque ETag as Version.

Exactly one condition is required. Backend never performs an unconditional last-writer-wins write.

type Config

type Config struct {
	// Bucket is the S3-compatible bucket that contains catalog objects.
	Bucket string
	// MaxObjectBytes bounds each object read and write. Zero uses
	// resourcepolicy.MaxPayloadBytes.
	MaxObjectBytes int64
}

Config describes one caller-owned S3 bucket.

Jump to

Keyboard shortcuts

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