s3

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package s3 is doze-aws's from-scratch S3 service. It speaks the REST-XML protocol both SDK generations produce, in both addressing styles (path-style /bucket/key and virtual-hosted bucket.host/key), and accepts the full upload-body matrix: plain, UNSIGNED-PAYLOAD, signed aws-chunked, and trailer-checksum streaming (aws-sdk-go-v2's default). Versioning, multipart, conditional reads AND writes, flexible checksums (CRC32/C, CRC64NVME, SHA1/256), object tagging, CORS with real preflight evaluation, lifecycle expiration enforced by a janitor, object lock (retention + legal hold), and bucket-website index/error serving are all functional.

See docs/api-support/s3.md for the operation-by-operation support table.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// DataDir holds the metadata database and blob files. Required.
	DataDir string
	// Host is the base host for virtual-hosted-style addressing: a request
	// whose Host is <bucket>.<Host> addresses that bucket. Path-style always
	// works. Empty disables vhost detection (path-style only).
	Host string
	// Peers is how S3 event notifications reach SNS/SQS/Lambda targets.
	Peers peers.Directory
	// Logf receives log lines; nil discards.
	Logf func(format string, args ...any)
	// Clock overrides time.Now in tests.
	Clock func() time.Time
}

Options configures the service.

type Server

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

Server is the S3 service: an http.Handler + io.Closer.

func New

func New(opts Options) (*Server, error)

New opens the store under DataDir and starts the lifecycle janitor.

func (*Server) Close

func (s *Server) Close() error

Close stops the janitor and closes the store.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) SweepLifecycleNow

func (s *Server) SweepLifecycleNow()

SweepLifecycleNow runs one lifecycle sweep immediately (tests drive this with an injected clock instead of waiting for the janitor tick).

Jump to

Keyboard shortcuts

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