fakes3

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package fakes3 provides an in-process S3-compatible service for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an in-memory S3-compatible HTTP service.

func New

func New(t testing.TB, buckets ...string) *Server

New starts an in-process S3 service with the requested buckets.

func (*Server) Config

func (s *Server) Config(bucket string) *storepb.StorageS3Config

Config returns a storage configuration that connects to the fake service.

func (*Server) GetObject

func (s *Server) GetObject(bucket, key string) ([]byte, error)

GetObject reads an object directly from the in-memory store.

func (*Server) PutObject

func (s *Server) PutObject(bucket, key, contentType string, content []byte) error

PutObject writes an object directly into the in-memory store, bypassing the HTTP API, for arranging state that predates the code under test.

Jump to

Keyboard shortcuts

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