uploadtest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package uploadtest provides an in-memory upload.Storage for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(name, contentType, body string) *upload.File

File builds an upload.File with the given contents.

Types

type Storage

type Storage struct {
	Objects map[string]string
	Deleted []string
	PutErr  error
	// contains filtered or unexported fields
}

Storage is an in-memory object store.

func New

func New() *Storage

func (*Storage) Delete

func (s *Storage) Delete(_ context.Context, key string) error

func (*Storage) Exists

func (s *Storage) Exists(_ context.Context, key string) (bool, error)

func (*Storage) PublicURL

func (s *Storage) PublicURL(key string) string

func (*Storage) Put

func (s *Storage) Put(_ context.Context, key string, body io.Reader, _ int64, _ string) error

Jump to

Keyboard shortcuts

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