uploads

package
v0.0.0-...-98cd694 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Providers represents this package's offering to the dependency manager.
	Providers = wire.NewSet(
		ProvideUploadManager,
		wire.FieldsOf(new(*Config),
			"Storage",
		),
	)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Storage objectstorage.Config `json:"storageConfig" toml:"storage_config,omitempty"`
	Debug   bool                 `json:"debug"         toml:"debug,omitempty"`
	// contains filtered or unexported fields
}

Config contains settings regarding search indices.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a Config struct.

type RootUploadDirectory

type RootUploadDirectory string

RootUploadDirectory is a type alias for dependency injection's sake.

type UploadManager

type UploadManager interface {
	SaveFile(ctx context.Context, path string, content []byte) error
	ReadFile(ctx context.Context, path string) ([]byte, error)
	ServeFiles(res http.ResponseWriter, req *http.Request)
}

UploadManager stores data in a given storage provider.

func ProvideUploadManager

func ProvideUploadManager(u *objectstorage.Uploader) UploadManager

ProvideUploadManager transforms an *objectstorage.Uploader into an UploadManager.

Directories

Path Synopsis
Package images is largely (and respectfully) inspired by/copied from this repo: github.com/olahol/go-imageupload
Package images is largely (and respectfully) inspired by/copied from this repo: github.com/olahol/go-imageupload

Jump to

Keyboard shortcuts

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