file

package
v0.0.0-...-e675dcb Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend object

func NewBackend

func NewBackend() (b *Backend)

NewBackend instantiate a new Testing Data Backend from configuration passed as argument

func (*Backend) AddFile

func (b *Backend) AddFile(file *common.File, fileReader io.Reader) (err error)

AddFile implementation for testing data backend will creates a new file for the given upload and save it on filesystem with the given file reader

func (*Backend) GetFile

func (b *Backend) GetFile(file *common.File) (reader io.ReadCloser, err error)

GetFile implementation for testing data backend will search on filesystem the asked file and return its reading filehandle

func (*Backend) GetFiles

func (b *Backend) GetFiles() (files map[string][]byte)

GetFiles return the content of the backend for testing purposes

func (*Backend) RemoveFile

func (b *Backend) RemoveFile(file *common.File) (err error)

RemoveFile implementation for testing data backend will delete the given file from filesystem

func (*Backend) SetError

func (b *Backend) SetError(err error)

SetError set the error that this backend will return on any subsequent method call

Jump to

Keyboard shortcuts

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