Documentation ¶
Overview ¶
imsto core objects
Index ¶
- Constants
- Variables
- 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
- 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
- type Author
- type Entry
- 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)
- type FLock
- type FetchInput
- type HttpError
- type IID
- type MetaFilter
- type MetaWrap
- 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
- type StringArray
- type StringSlice
- type Ticket
- type VerID
Constants ¶
View Source
const ( ASCENDING = 1 DESCENDING = -1 )
View Source
const ( DefaultMaxMemory = 12 << 20 // 8 MB APIKeyHeader = "X-Access-Key" )
consts
View Source
const ( VC_TOKEN valueCate = 1 VC_TICKET valueCate = 2 )
View Source
const (
// ViewName ...
ViewName = "show"
)
Variables ¶
View Source
var ( ErrWriteFailed = errors.New("Err: Write file failed") ErrEmptyRoof = errors.New("empty roof") ErrEmptyID = errors.New("empty id") ErrZeroSize = errors.New("zero size") )
errors
View Source
var (
ErrDbError = errors.New("database error")
)
Functions ¶
func BytesToInt64 ¶
func InitMetaTables ¶
func InitMetaTables()
func Int64ToBytes ¶
Types ¶
type App ¶
type App struct { Id AppID `json:"id,omitempty"` Version VerID `json:"api_ver,omitempty"` ApiKey string `json:"api_key,omitempty"` ApiSalt string `json:"api_salt,omitempty"` Name string `json:"name,omitempty"` Created time.Time `json:"created,omitempty"` Disabled bool `json:"disabled,omitempty"` }
func (*App) RequestNewToken ¶
func (*App) TicketRequestLoad ¶
func (*App) TicketRequestNew ¶
TicketRequestNew ... deprecated
func (*App) VerifyToken ¶
VerifyToken ...
type Entry ¶
type Entry struct { Id imagid.IID `json:"id"` Name string `json:"name"` Size uint32 `json:"size"` Path string `json:"path"` Status uint8 `json:"-"` Hashes StringArray `json:"hashes,omitempty"` IDs StringArray `json:"-"` Roofs StringArray `json:"roofs,omitempty"` Tags StringArray `json:"tags,omitempty"` Meta *iimg.Attr `json:"meta,omitempty"` AppId AppID `json:"appid,omitempty"` Author Author `json:"author,omitempty"` Created time.Time `json:"created,omitempty"` Err string `json:"err,omitempty"` Done chan bool `json:"-"` // contains filtered or unexported fields }
func NewEntryConvert ¶
func NewEntryReader ¶
func NewEntryReader(rs io.ReadSeeker, name string) (e *Entry, err error)
NewEntryReader ...
func PrepareReader ¶
func PrepareReader(r io.ReadSeeker, name string) (entry *Entry, err error)
PrepareReader ...
type FLock ¶
type FLock struct {
// contains filtered or unexported fields
}
FLock is a file-based lock
type FetchInput ¶
FetchInput ...
type MetaWrap ¶
type MetaWrap struct {
// contains filtered or unexported fields
}
MetaWrap ...
func (*MetaWrap) GetMapping ¶
func (*MetaWrap) TableSuffix ¶
type MetaWrapper ¶
type MetaWrapper interface { Browse(limit, offset int, sort map[string]int, filter MetaFilter) ([]*Entry, error) Count(filter MetaFilter) (int, error) Ready(entry *Entry) error SetDone(id string, sev cdb.JsonKV) error Save(entry *Entry, isUpdate bool) error BatchSave(entries []*Entry) error GetMeta(id string) (*Entry, error) GetHash(hash string) (*ehash, error) GetMapping(id string) (*mapItem, error) Delete(id string) error MapTags(id string, tags string) error UnmapTags(id string, tags string) error }
MetaWrapper ...
func NewMetaWrapper ¶
func NewMetaWrapper(roof string) (mw MetaWrapper)
type StringArray ¶
type StringArray = cdb.StringArray
type StringSlice ¶
type StringSlice = cdb.StringSlice
type Ticket ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.