storage

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func ResetName

func ResetName(name string) string

func SetPath

func SetPath(path ...string) string

Types

type Option

type Option func(o *Options)

Option sets values in Options

func WithContext

func WithContext(c context.Context) Option

WithContext sets the Storages context, for any extra configuration

type Options

type Options struct {
	// Context should contain all implementation specific options, using context.WithValue.
	Context context.Context
}

Options contains configuration for the Storage

type Resource

type Resource struct {
	Url  *url.URL `json:"-"`
	Host string   `json:"host"`
	File string   `json:"file"`
	Path string   `json:"path"`
	Name string   `json:"name"`
	Size int64    `json:"size"`
	Ext  string   `json:"ext"`
}

type Storage

type Storage interface {
	Upload(*multipart.FileHeader, ...string) (*Resource, error)
	Delete(string) error
	// String returns the name of the implementation.
	String() string
}

Storage is a data storage interface

func NewNoop

func NewNoop() Storage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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