Documentation ¶
Index ¶
- Constants
- Variables
- type FileMeta
- type ID
- type Index
- func (index *Index) Decode(r io.Reader) error
- func (index *Index) Encode(w io.Writer) (uint64, error)
- func (index *Index) FilesWithPreviewStat() (int, int, uint32)
- func (index *Index) OutDated() bool
- func (index *Index) Pull(id ID) (*Meta, error)
- func (index *Index) PullChildren(id ID) ([]*Meta, error)
- func (index *Index) PullPaths(id ID) ([]*Meta, error)
- func (index *Index) PullPreview(id ID) ([]byte, error)
- func (index *Index) Search(query string, dirID ID) []*Meta
- type Meta
- type Option
- type Path
- type PreviewGenerator
- type PreviewLocation
- type RelativePath
- type Resolution
Constants ¶
View Source
const ( ContentTypeVideo ContentTypeImage ContentTypeOther ContentTypeDir )
Variables ¶
View Source
var ( ErrSemaphoreAcquire = errors.New("failed to acquire the semaphore") ErrFileLoad = errors.New("failed to load file") ErrPreviewPull = errors.New("failed to preview") )
View Source
var ( ErrInvalidHeader = errors.New("invalid header") ErrReadHeader = errors.New("failed to read header") ErrReadMetaItemsCount = errors.New("failed to read meta items count") ErrReadMetaPartSize = errors.New("failed to read meta's part size") ErrReadMetaPart = errors.New("failed to read meta items") ErrMetaItemDecode = errors.New("failed to decode meta's item") ErrReadBinaryData = errors.New("failed to read binary data") ErrWriteHeader = errors.New("failed to write header") ErrWriteMetaItemsCount = errors.New("failed to write meta items count") ErrEncodeMetaItem = errors.New("failed to encode meta's item") ErrWriteMetaPartSize = errors.New("failed to write meta's part size") ErrWriteMetaPart = errors.New("failed to write meta items") ErrWriteBinaryData = errors.New("failed to write binary data") ErrJSONEncode = errors.New("failed to JSON encode item") ErrGZIPDecode = errors.New("failed to decode gzip") ErrGZIPDecoderClose = errors.New("failed to close gzip decoder") ErrGZIPEncode = errors.New("failed to encode gzip") ErrGZIPEncoderClose = errors.New("failed to close gzip encoder") ErrMetaDecode = errors.New("failed to decode meta data") ErrMetaEncode = errors.New("failed to encode meta data") )
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct { ID ID `json:"id"` AbsolutePath Path `json:"absolutePath"` RelativePath RelativePath `json:"relativePath"` OriginSize int64 `json:"originSize"` Name string `json:"name"` ModTime time.Time `json:"modTime"` IsDir bool `json:"isDir"` Preview PreviewLocation `json:"preview"` Duration time.Duration `json:"duration"` Resolution Resolution `json:"resolution"` Extension string `json:"extension"` Type int `json:"type"` }
func (*Meta) IsAnimatedImage ¶ added in v1.2.0
func (*Meta) IsOtherFile ¶
type Option ¶
type Option func(*indexBuilder)
func WithNewFiles ¶
func WithNewFiles(f func()) Option
func WithPreview ¶
func WithPreview(gen PreviewGenerator) Option
func WithProgress ¶
func WithProgress(f func()) Option
func WithWorkers ¶
type PreviewGenerator ¶
type PreviewLocation ¶ added in v1.1.0
type RelativePath ¶ added in v1.1.0
type RelativePath string
type Resolution ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.