store

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAccessDenied = errors.New("Access denied!")
	ErrServerError  = errors.New("Server error")
	ErrFileExists   = errors.New("File exists")
	ErrNotFound     = errors.New("File not found")
)

Errors

Functions

func Del

func Del(store, id string) error

Del removes file from fs

func Exists

func Exists(store, id string) bool

Exists returns true if file already stored

func File

func File(_store, fileID, fileName string, _file []byte) error

File stores file to fs

func Get

func Get(store, id string) (string, []byte, error)

Get returns fileName and content from appFs or error

Types

type Item added in v0.0.28

type Item struct {
	ID         string     `json:"_id"`
	Name       string     `json:"name"`
	Store      string     `json:"store"`
	Size       int        `json:"size,omitempty"`
	UploadedAt *time.Time `json:"uploadedAt,omitempty"`
}

func List added in v0.0.28

func List(store string, skip, take int) ([]*Item, error)

List returs list of files in store. Result can by limited by skip and take params

Jump to

Keyboard shortcuts

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