bucket

package
v0.0.0-...-8f1e39b Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRemovalFolder = errors.New("can't remove folder")

ErrRemovalFolder will be raised when end user is trying to delete a folder and not a file.

Functions

func HTTPMiddleware

func HTTPMiddleware(
	tgt *config.TargetConfig,
	path string,
	s3clientManager s3client.Manager,
	wbManager webhook.Manager,
) func(next http.Handler) http.Handler

Types

type Client

type Client interface {
	// Get allow to GET what's inside a request path
	Get(ctx context.Context, input *GetInput)
	// Put will put a file following input
	Put(ctx context.Context, inp *PutInput)
	// Delete will delete file on request path
	Delete(ctx context.Context, requestPath string)
	// Load file content. (Should be used internally only).
	LoadFileContent(ctx context.Context, path string) (string, error)
}

Client represents a client in order to GET, PUT or DELETE file on a bucket with a html output.

func GetBucketRequestContextFromContext

func GetBucketRequestContextFromContext(ctx context.Context) Client

func NewClient

func NewClient(
	tgt *config.TargetConfig,
	mountPath string,
	s3clientManager s3client.Manager,
	wbManager webhook.Manager,
) Client

NewClient will generate a new client to do GET,PUT or DELETE actions.

type GetInput

type GetInput struct {
	RequestPath       string
	IfModifiedSince   *time.Time
	IfMatch           string
	IfNoneMatch       string
	IfUnmodifiedSince *time.Time
	Range             string
}

GetInput represents Get input.

type PutData

type PutData struct {
	User  models.GenericUser
	Input *PutInput
	Key   string
}

PutData Put Data represents a put data structure used in put templates rendering.

type PutInput

type PutInput struct {
	RequestPath string
	Filename    string
	Body        io.ReadSeeker
	ContentType string
	ContentSize int64
}

PutInput represents Put input.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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