Documentation ¶
Overview ¶
imsto core objects
Index ¶
- Constants
- Variables
- func BytesToInt64(buf []byte) int64
- func Close()
- func Delete(roof, id string) error
- func GetURI(suffix string) string
- func InitMetaTables()
- func Int64ToBytes(i int64) []byte
- func LoadPath(u string, walk thumbs.WalkFunc) error
- func ParseTags(s string) (cdb.StringArray, 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 DBTxer
- type DBer
- type Entry
- type FetchInput
- type File
- type HashEntry
- 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) (he *HashEntry, err 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) NextID() (nid uint64, err 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.Meta) error
- func (mw *MetaWrap) UnmapTags(id string, tags string) error
- type MetaWrapper
- type Queryer
- type StringArray
- type StringSlice
- type Ticket
- type VerID
Constants ¶
View Source
const ( ASCENDING = 1 DESCENDING = -1 )
View Source
const ( CatView = "show" CatStore = "stores" CatThumb = "thumb" )
consts Cate of Key
View Source
const ( VC_TOKEN valueCate = 1 VC_TICKET valueCate = 2 )
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") ErrInvalidRoof = errors.New("empty roof") )
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 imid.IID `json:"id"` Name string `json:"name"` Size uint32 `json:"size"` Path string `json:"path"` Status uint8 `json:"-"` Hashes cdb.Meta `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"` Key string `json:"key,omitempty"` // for upload response Err string `json:"error,omitempty"` // for upload response // contains filtered or unexported fields }
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 FetchInput ¶
FetchInput ...
type MetaWrap ¶
type MetaWrap struct {
// contains filtered or unexported fields
}
MetaWrap ...
func (*MetaWrap) GetMapping ¶
type MetaWrapper ¶
type MetaWrapper interface { Browse(limit, offset int, sort map[string]int, filter MetaFilter) ([]*Entry, error) Count(filter MetaFilter) (int, error) NextID() (uint64, error) Ready(entry *Entry) error SetDone(id string, sev cdb.Meta) error Save(entry *Entry, isUpdate bool) error BatchSave(entries []*Entry) error GetMeta(id string) (*Entry, error) GetHash(hash string) (*HashEntry, error) GetMapping(id string) (*mapItem, error) Delete(id string) error MapTags(id string, tags string) error UnmapTags(id string, tags string) error }
MetaWrapper ...
type Queryer ¶ added in v1.5.4
type Queryer interface { Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row Exec(query string, args ...interface{}) (sql.Result, error) }
Queryer ...
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.