paste

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Unlicense Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buckets

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

type NamedRule

type NamedRule struct {
	Name string
	Rule Rule
}

type Params

type Params struct {
	fx.In

	Loader  *config.Loader
	Storage *storage.Storage

	Ctx context.Context
	Lc  fx.Lifecycle
	Log *slog.Logger
}

type Paste

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

func (*Paste) PrepareUpload

func (o *Paste) PrepareUpload(bucket string, uploadedFile string, rd io.Reader, extra *storage.Metadata) (*Upload, error)

first prepare the upload

func (*Paste) ReadPaste

func (o *Paste) ReadPaste(w http.ResponseWriter, r *http.Request, bucket string, filename string) error

func (*Paste) Upload

func (o *Paste) Upload(ctx context.Context, w io.Writer, args *Upload) error

type Result

type Result struct {
	fx.Out

	Output *Paste
}

func New

func New(p Params) (r Result, err error)

type Rule

type Rule func(*Upload)

func Rules

func Rules(xs ...Rule) Rule

type Upload

type Upload struct {
	Bucket           string
	OriginalFilename string
	Filename         string
	Reader           io.Reader
	Extra            *storage.Metadata
}

Jump to

Keyboard shortcuts

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