s3test

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 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 s3test is a small in-memory S3 server for tests: buckets, objects, listing and multipart uploads, addressed by path. It checks no signatures.

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 the fake.

func New

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

New starts a server with the given buckets; it stops with the test.

func (*Server) Deny

func (s *Server) Deny(code string)

Deny refuses every request with an S3 error code ("" accepts them again).

func (*Server) Get

func (s *Server) Get(bucket, key string) ([]byte, bool)

Get returns an object's content.

func (*Server) Keys

func (s *Server) Keys(bucket string) []string

Keys lists a bucket's objects in order.

func (*Server) Put

func (s *Server) Put(bucket, key string, data []byte, at time.Time)

Put stores an object, last modified at.

func (*Server) ServeHTTP

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

Jump to

Keyboard shortcuts

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