core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext()

func GetUpload

func GetUpload(key hsk.Key) (hsk.Record, error)

func GetUploadFile

func GetUploadFile(key hsk.Key) (result []byte, filename string, err error)

func GetUploads

func GetUploads(page, pagesize int) (records.Page, error)

func GetUploadsBySize

func GetUploadsBySize(size int64) (records.Page, error)

GetUploadsBySize returns the first 50 records larger than @size bytes.

func NewBLOB

func NewBLOB(data io.Reader, purpose string) ([]byte, string, error)

func OptimizeFor added in v1.0.0

func OptimizeFor(data io.Reader, oType optimizetype.Enum) ([]byte, string, error)

OptimizeFor returns the new Bytes, MIME Type and an error

func RemoveUpload added in v1.0.0

func RemoveUpload(key hsk.Key) error

func SaveFile added in v1.0.0

func SaveFile(b io.Reader, header *multipart.FileHeader, info InfoHead) (hsk.Key, error)

func Shutdown

func Shutdown()

Types

type InfoHead added in v1.0.0

type InfoHead struct {
	For      string
	ItemKey  *keys.TimeKey
	ItemName string
}

func GetInfoHead added in v1.0.0

func GetInfoHead(header string) (InfoHead, error)

type Upload

type Upload struct {
	ItemKey  *keys.TimeKey
	ItemName string `hsk:"size(75)"`
	Name     string `hsk:"size(50)"`
	MimeType string `hsk:"size(30)"`
	Size     int64
	BLOB     []byte `json:"-"` //Blob shouldn't be returned in JSON result sets.
}

func (Upload) Create

func (u Upload) Create() (hsk.Key, error)

func (Upload) Valid

func (u Upload) Valid() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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