g3

server

import "github.com/afreidah/g3/internal/server"

Index

type MultipartStore

MultipartStore manages in-progress multipart uploads in memory.

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

func NewMultipartStore

func NewMultipartStore(ttl time.Duration) *MultipartStore

NewMultipartStore creates a store with the given TTL for abandoned uploads.

func (*MultipartStore) CleanExpired

func (s *MultipartStore) CleanExpired() int

CleanExpired removes uploads older than the configured TTL.

func (*MultipartStore) StartCleanupLoop

func (s *MultipartStore) StartCleanupLoop(ctx context.Context)

StartCleanupLoop runs a background goroutine that periodically removes expired uploads. Stops when the context is cancelled.

type Server

Server is the S3-compatible HTTP handler.

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

func New

func New(b backend.ObjectBackend, r *auth.BucketRegistry) *Server

New creates an S3 server backed by the given ObjectBackend and BucketRegistry. Initializes an in-memory multipart upload store with a 1-hour TTL for abandoned uploads.

func (*Server) ServeHTTP

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

ServeHTTP dispatches S3 API requests. Every request gets a request ID, server span, and audit log entry.

func (*Server) StartMultipartCleanup

func (s *Server) StartMultipartCleanup(ctx context.Context)

StartMultipartCleanup begins a background goroutine that removes expired multipart uploads. Stops when the context is cancelled.

Generated by gomarkdoc