Documentation
¶
Overview ¶
Package schema is the schema of the SQLite store: its tables, its queries, and the types which are read from, and written to, them
Index ¶
- Constants
- func Create(ctx context.Context, conn sqlite.Conn) error
- func CreateCache(ctx context.Context, conn sqlite.Conn) error
- func Did(kind store.Kind) string
- func Functions() []sqlite.Opt
- func Match(query filer.Query) string
- func NewCacheQueries() (*sqlite.Queries, error)
- func NewQueries() (*sqlite.Queries, error)
- type ArtworkHash
- type ArtworkList
- type ArtworkPut
- type ArtworkUnlinked
- type CacheChunk
- type CacheCommit
- type CacheCreate
- type CacheData
- type CacheEntry
- type CacheExpired
- type CacheId
- type CacheIds
- type CacheKey
- type CachePrefix
- type CacheRead
- type Keys
- type Kinds
- type KindsRequest
- type ObjectArtwork
- type ObjectArtworkLink
- type ObjectCount
- type ObjectCountRequest
- type ObjectKey
- type ObjectList
- type ObjectListRequest
- type ObjectMetaPut
- type ObjectMetaSource
- type ObjectPut
- type Pending
- type QueueDid
- type QueueDue
- type QueueFailure
- type QueueKey
- type QueueLease
- type QueuePending
- type QueuePush
- type QueueStale
- type QueueTasks
- type RevisionListRequest
- type RevisionPut
- type Revisions
- type ScanChanged
- type ScanChangedList
- type ScanCount
- type ScanFolder
- type ScanSeen
- type ScanSweep
- type ScanUnsee
- type SearchCount
- type SearchHit
- type SearchHits
- type SearchRefresh
- type SearchRequest
- type VolumeArtwork
- type VolumeList
- type VolumeListRequest
- type VolumeName
- type VolumePut
- type VolumeState
- type WorkList
Constants ¶
const CacheVersion = 1
CacheVersion is the version of the cache's schema, of the database's user_version
const Version = 21
Version is the version of the schema, of the database's user_version
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates the schema, in a transaction, when the database hasn't one, and sets its version. A database whose schema is newer is an error.
func CreateCache ¶
CreateCache creates the cache's schema, when the database hasn't one, with its space reclaimed incrementally, and sets its version. A database whose schema is newer is an error.
func Did ¶
Did returns the kind of the rows of the revisions which a task's work is done of, which is its kind, with _done after it
func Functions ¶
Functions returns the options of the functions which the queries of the search of objects call, of each connection
func Match ¶
Match returns the FTS5 query of a query's terms, any of which match, of those which aren't excluded, or empty, without terms
func NewCacheQueries ¶
NewCacheQueries returns the cache's queries, which a connection is bound to, with WithQueries, so the types' selectors and writers use them
func NewQueries ¶
NewQueries returns the queries, which a connection is bound to, with WithQueries, so the types' selectors and writers use them
Types ¶
type ArtworkHash ¶ added in v0.6.0
ArtworkHash selects artwork, of its hash, which is got, with its data, when it's asked for
type ArtworkList ¶ added in v0.6.0
ArtworkList is the artwork which is read, of a get, which reads one, a list, or a delete
type ArtworkPut ¶ added in v0.6.0
type ArtworkPut filer.ArtworkMeta
ArtworkPut is artwork which is stored, of its hash, or the artwork of its hash, which is stored already, as it's linked to
type ArtworkUnlinked ¶ added in v0.6.0
type ArtworkUnlinked struct{}
ArtworkUnlinked selects the artwork which no object links to, which is deleted
type CacheChunk ¶
CacheChunk is a chunk of an entry's content, of its index
type CacheCommit ¶
type CacheCommit struct {
Id int64
Key string
Meta gofiler.CacheMeta
Size int64
Now time.Time
Expires time.Time
}
CacheCommit is an entry, which is written, of its key, and what it is
type CacheCreate ¶
CacheCreate is an entry, without a key, which its content is written to, whose id is returned
type CacheEntry ¶
type CacheEntry struct {
Id int64
Key string
Meta gofiler.CacheMeta
Size int64
Stored time.Time
Expires time.Time
}
CacheEntry is an entry of a volume's cache, as it's stored
type CacheExpired ¶
CacheExpired selects the entries whose TTLs have passed, at the time, which are released
type CacheIds ¶
type CacheIds []int64
CacheIds is the ids of the entries which are released, or deleted, or created
type CachePrefix ¶
type CachePrefix string
CachePrefix selects the entries of the keys which start with it, which are released
type Keys ¶ added in v0.6.0
type Keys []string
Keys are the keys of objects, or the hashes of artwork, which are read, of which rows a query returned
type Kinds ¶
Kinds is how many objects are of each kind, of their metadata, or else their media type, or "", of none
type KindsRequest ¶
type KindsRequest struct {
Volume string
}
KindsRequest selects how many objects, without folders, of a volume are of each kind
type ObjectArtwork ¶ added in v0.6.0
type ObjectArtwork struct {
Volume, Key string
}
ObjectArtwork selects an object, of its volume, and key, of which its links to artwork are listed, or deleted, and the object is got, so it's found, or not
type ObjectArtworkLink ¶ added in v0.6.0
type ObjectArtworkLink struct {
Volume, Key, Hash string
}
ObjectArtworkLink is a link of an object to artwork, of its hash, which is inserted
type ObjectCountRequest ¶
type ObjectCountRequest struct {
Volume string
store.ListRequest
}
ObjectCountRequest selects how many objects a listing has, of every page, without where it starts after, or its limit
type ObjectKey ¶
ObjectKey selects an object of a volume, of its key, which is got, or deleted, with every object beneath it, of a folder's
type ObjectList ¶
ObjectList is the objects which are read, of a list, or a get, which reads one
type ObjectListRequest ¶
type ObjectListRequest struct {
Volume string
store.ListRequest
}
ObjectListRequest selects the objects of a folder, or every object beneath it, in the order of their keys
type ObjectMetaPut ¶
ObjectMetaPut is the metadata of an object of a volume, of a source, which replaces the source's
type ObjectMetaSource ¶
ObjectMetaSource selects the metadata of a source of a volume, and its task's state, which is deleted
type ObjectPut ¶
ObjectPut is an object of a volume, which is put, with its metadata
type QueueDid ¶
type QueueDid struct {
Volume string
Key string
Kind store.Kind
Revision string
Error string // Why it was given up, or empty when it was done
Now time.Time
}
QueueDid is the revision of a file which a task's work was done of
type QueueDue ¶
QueueDue selects the work of a volume, of the kinds, which is due, and isn't leased, at the time, up to the limit
type QueueFailure ¶
type QueueFailure struct {
Error string
Outage bool // It failed as its backend was unavailable, which isn't an attempt
Failed time.Time // When it failed
After time.Time // When it's due again
}
QueueFailure is why work failed, and when it's due again
type QueueKey ¶
QueueKey selects work of a volume, of its key and kind, which is leased, done, or failed, of its lease
type QueueLease ¶
QueueLease is the lease of work, until when it ends
type QueuePending ¶
type QueuePending struct {
Volume string
Key string
Beneath bool // Work beneath the folder's key too, of its listing
}
QueuePending selects whether a key of a volume has work which would change its index
type QueuePush ¶
QueuePush is work of a volume, which is pushed
type QueueStale ¶
type QueueStale struct {
Volume string
Folder string
Kind store.Kind
Now time.Time
Trace string // The W3C traceparent of the span which queued it, or empty
}
QueueStale is the work of a task of the files beneath a folder, which are stale
type QueueTasks ¶
QueueTasks is the work of a task of a volume's files, which is read
type RevisionListRequest ¶
RevisionListRequest selects the revisions of the files of a folder's key, or beneath it
type RevisionPut ¶
RevisionPut is the revision of a file of a volume, which is put
type ScanChanged ¶
ScanChanged selects the files which a scan of a folder of a volume has seen, which have changed, after the key, up to the limit
type ScanChangedList ¶
ScanChangedList is the files which are read, which have changed
type ScanFolder ¶
ScanFolder selects what a scan of a folder of a volume has seen, which is forgotten, swept, or counted, of its changed files
type ScanSeen ¶
ScanSeen is a key of a volume which a scan has seen, with the revision of its listing, which is put
type ScanSweep ¶
type ScanSweep ScanFolder
type ScanUnsee ¶
type ScanUnsee ScanFolder
ScanUnsee, and ScanSweep, are the deletions of a scan's folder
type SearchCount ¶
SearchCount is how many objects match a search, and the score of the best
func (SearchCount) Rank ¶
func (count SearchCount) Rank(score float64) float32
Rank returns how well a score matches, of 0 to 1, of the best of its search's, which is 1
type SearchHit ¶
SearchHit is an object which matches a search, of its volume, and key, and its score, of bm25, which is the better, the more negative
type SearchHits ¶
type SearchHits []SearchHit
SearchHits are the objects which match a search, best first
type SearchRefresh ¶
SearchRefresh is the search of the objects of a volume, of the range of their keys, from one, to one after, which is refreshed, of what they are now
func KeyRefresh ¶
func KeyRefresh(volume, key string) SearchRefresh
////////////////////////////////////////////////////////////////////////////// KeyRefresh returns the refresh of the search of an object, of its key
func VolumeRefresh ¶
func VolumeRefresh(volume string) SearchRefresh
VolumeRefresh returns the refresh of the search of every object of a volume
type SearchRequest ¶
type SearchRequest struct {
filer.SearchRequest
}
SearchRequest selects the objects which match a query, best first, of the weights of their columns, of its page, or, of a get, how many match
type VolumeArtwork ¶ added in v0.6.0
type VolumeArtwork string
VolumeArtwork selects the links of the objects of a volume to their artwork, which are deleted, as what a task found of them is, or alone
type VolumeList ¶
VolumeList is the volumes which are read, of a list, or a get, which reads one
type VolumeListRequest ¶
type VolumeListRequest struct{}
VolumeListRequest selects every volume, in the order of their names
type VolumeName ¶
type VolumeName string
VolumeName selects a volume, of its name, which is got, or deleted
type VolumePut ¶
type VolumePut filer.VolumeMeta
VolumePut is a volume which is created, or whose URL, and whether it's enabled, are updated
type VolumeState ¶
type VolumeState struct {
Name string
filer.IndexState
}
VolumeState is the state of a volume's index, of its name, which is got, and updated