filestore

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStore

type FileStore interface {
	Add(string, []byte) (string, error) // Add creates a file with name & content to the storage, returns id
	Remove(string) bool                 // Remove deletes a file by id
	Get(string) file.File               // Get file by id, nil if not exists
	List() []string                     // List return all file ids
}

FileStore defines interface to store file

func NewFileLocalStore

func NewFileLocalStore(dir string) FileStore

NewFileLocalStore create new local file store

func NewFileMemoryStore

func NewFileMemoryStore() FileStore

NewFileMemoryStore create new memory file store

Jump to

Keyboard shortcuts

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