uploads

package
v0.0.0-...-9518a5e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT 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 storage.Config `json:"storage_config" mapstructure:"storage_config" toml:"storage_config,omitempty"`
	Debug   bool           `json:"debug" mapstructure:"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 *storage.Uploader) UploadManager

ProvideUploadManager transforms a *storage.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