Versions in this module Expand all Collapse all v1 v1.5.9 Nov 3, 2024 v1.5.8 Jul 26, 2024 v1.5.7 Feb 28, 2024 v1.5.6 Jan 16, 2024 v1.5.5 Jun 19, 2023 v1.5.5-alpha Jun 19, 2023 v1.5.4 Jun 19, 2023 Changes in this version + var ErrInvalidRoof = errors.New("empty roof") + func Close() + func GetURI(suffix string) string + type DBTxer interface + Commit func() error + Rollback func() error + type DBer interface + Begin func() (*sql.Tx, error) type Entry + Key string + func (e *Entry) GetHash() string + func (e *Entry) URI(sizeOp string) string + type File = thumbs.File + type Queryer interface + Exec func(query string, args ...interface{}) (sql.Result, error) + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryRow func(query string, args ...interface{}) *sql.Row v1.5.0 Nov 18, 2019 Changes in this version + const CatStore + const CatThumb + const CatView type Entry + func (e *Entry) StoredMeta() cdb.Meta + type HashEntry struct + ID IID + Path string type MetaWrap + func (mw *MetaWrap) NextID() (nid uint64, err error) type MetaWrapper + NextID func() (uint64, error) v1.4.1 Oct 27, 2019 v1.4.0 Oct 27, 2019 Changes in this version + const APIKeyHeader + const ASCENDING + const DESCENDING + const DefaultMaxMemory + const VC_TICKET + const VC_TOKEN + const ViewName + var ErrDbError = errors.New("database error") + var ErrEmptyID = errors.New("empty id") + var ErrEmptyRoof = errors.New("empty roof") + var ErrWriteFailed = errors.New("Err: Write file failed") + var ErrZeroSize = errors.New("zero size") + func BytesToInt64(buf []byte) int64 + func CheckAPIKey(next http.Handler) http.Handler + func Delete(roof, id string) error + func Dump(key, roof, file string) error + func GetURL(scheme, suffix string) string + func InitMetaTables() + func Int64ToBytes(i int64) []byte + func LoadPath(u string) (oi *outItem, err error) + func ParseTags(s string) (cdb.StringArray, error) + func PullBlob(key string, roof string) (data []byte, err error) + func ReadyDir(filename string) error + func SaveFile(filename string, data []byte) error + type App struct + ApiKey string + ApiSalt string + Created time.Time + Disabled bool + Id AppID + Name string + Version VerID + func AppFromContext(ctx context.Context) (a *App, ok bool) + func LoadApp(api_key string) (app *App, err error) + func NewApp(name string) (app *App) + func (a *App) RequestNewToken(uid int) string + func (a *App) Save() error + func (a *App) TicketRequestLoad(token, roof string, author int) (ticket *Ticket, err error) + func (a *App) TicketRequestNew(roof, token string, uid int, prompt string) (t *apiToken, err error) + func (a *App) VerifyToken(token string) (at *apiToken, err error) + type AppID uint16 + type Author uint32 + type Entry struct + AppId AppID + Author Author + Created time.Time + Done chan bool + Err string + Hashes StringArray + IDs StringArray + Id imagid.IID + Meta *iimg.Attr + Name string + Path string + Roofs StringArray + Size uint32 + Status uint8 + Tags StringArray + func Fetch(in FetchInput) (entry *Entry, err error) + func NewEntryConvert(id, name, path string, size uint32, meta, sev types.JsonKV, ...) (entry *Entry, err error) + func NewEntryReader(rs io.ReadSeeker, name string) (e *Entry, err error) + func PopReadyDone() (entry *Entry, err error) + func PrepareFile(file, name string) (entry *Entry, err error) + func PrepareReader(r io.ReadSeeker, name string) (entry *Entry, err error) + func (e *Entry) IsDone() bool + func (e *Entry) PushTo(roof string) (sev cdb.JsonKV, err error) + func (e *Entry) Store(roof string) (ch chan error) + func (e *Entry) Trek(roof string) (err error) + type FLock struct + func NewFLock(path string) (FLock, error) + func (lock FLock) Lock() error + func (lock FLock) TryLock() (bool, error) + func (lock FLock) Unlock() error + type FetchInput struct + AppID int + Referer string + Roof string + URI string + UserID int + type HttpError struct + Code int + Path string + Text string + func NewHttpError(code int, text string) *HttpError + func (ie *HttpError) Error() string + type IID = imagid.IID + type MetaFilter struct + App AppID + Author Author + Tags string + type MetaWrap struct + func (mw *MetaWrap) BatchSave(entries []*Entry) error + func (mw *MetaWrap) Browse(limit, offset int, sort map[string]int, filter MetaFilter) (a []*Entry, err error) + func (mw *MetaWrap) Count(filter MetaFilter) (t int, err error) + func (mw *MetaWrap) Delete(id string) error + func (mw *MetaWrap) GetHash(hash string) (*ehash, error) + func (mw *MetaWrap) GetMapping(id string) (*mapItem, error) + func (mw *MetaWrap) GetMeta(id string) (entry *Entry, err error) + func (mw *MetaWrap) MapTags(id string, tags string) error + func (mw *MetaWrap) Ready(entry *Entry) error + func (mw *MetaWrap) Save(entry *Entry, isUpdate bool) error + func (mw *MetaWrap) SetDone(id string, sev cdb.JsonKV) error + func (mw *MetaWrap) TableSuffix() string + func (mw *MetaWrap) UnmapTags(id string, tags string) error + type MetaWrapper interface + BatchSave func(entries []*Entry) error + Browse func(limit, offset int, sort map[string]int, filter MetaFilter) ([]*Entry, error) + Count func(filter MetaFilter) (int, error) + Delete func(id string) error + GetHash func(hash string) (*ehash, error) + GetMapping func(id string) (*mapItem, error) + GetMeta func(id string) (*Entry, error) + MapTags func(id string, tags string) error + Ready func(entry *Entry) error + Save func(entry *Entry, isUpdate bool) error + SetDone func(id string, sev cdb.JsonKV) error + UnmapTags func(id string, tags string) error + func NewMetaWrapper(roof string) (mw MetaWrapper) + type StringArray = cdb.StringArray + type StringSlice = cdb.StringSlice + type Ticket struct + AppID AppID + Author Author + Done bool + ImgId string + ImgPath string + Prompt string + func (t *Ticket) GetId() int + type VerID uint8