filedata

package
v0.0.1-0...-1b1769d Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Delete

func Delete(id string) error

func ForEach

func ForEach(f func(*FileData))

func Init

func Init() error

Types

type FileData

type FileData struct {
	Filename  string    `json:"filename"`
	Mimetype  string    `json:"mimetype"`
	Size      int64     `json:"size"`
	Timestamp time.Time `json:"timestamp"`
	// contains filtered or unexported fields
}

func NewFromId

func NewFromId(id string) (*FileData, error)

func NewFromRequest

func NewFromRequest(r *http.Request) ([]*FileData, error)

func (*FileData) GetFilename

func (f *FileData) GetFilename() string

func (*FileData) GetId

func (f *FileData) GetId() string

func (*FileData) Read

func (f *FileData) Read() (io.ReadCloser, error)

func (*FileData) Serve

func (f *FileData) Serve(w http.ResponseWriter, r *http.Request, filename string, mimetype string, timestamp time.Time, attachment bool) error

Directories

Path Synopsis
s3

Jump to

Keyboard shortcuts

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