backendtest

package
v0.0.0-...-e2627ae Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package backendtest provides utilities for backend testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewS3FakeBackend

func NewS3FakeBackend(config ...backend.S3BackendConfig) (backend.Backend, error)

S3 implementation for a fake Backend Interface, all methods are the same except delete

Types

type S3FakeBackend

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

Fake s3 backend implementation

func (*S3FakeBackend) BatchDeleteObjects

func (b *S3FakeBackend) BatchDeleteObjects(objects []backend.BucketObject) error

func (*S3FakeBackend) CopyObject

func (b *S3FakeBackend) CopyObject(sourceObject backend.BucketObject, destinationObject backend.BucketObject) error

Fake copy, does nothing except returning some errors when the keyword "notfound" are used

func (*S3FakeBackend) CreatePresignedURLForDownload

func (b *S3FakeBackend) CreatePresignedURLForDownload(object backend.BucketObject, expire time.Duration) (string, error)

Create presigned url for download just like for a real s3 backend

func (*S3FakeBackend) CreatePresignedURLForUpload

func (b *S3FakeBackend) CreatePresignedURLForUpload(object backend.BucketObject, expire time.Duration) (string, error)

Create presigned url for upload just like for a real s3 backend

func (*S3FakeBackend) DeleteObject

func (b *S3FakeBackend) DeleteObject(object backend.BucketObject) error

Delete action for an object in a bucket, in our case does nothing because no real backend

Jump to

Keyboard shortcuts

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