Documentation
¶
Index ¶
- func DiscoverReader(root string, opts DiscoverOptions) (Reader, []StoreCandidate, error)
- func ExplainCandidate(candidate StoreCandidate) string
- func PotentialFutureAdapter(candidate StoreCandidate) bool
- type CandidateKind
- type CandidateSource
- type DiscoverOptions
- type InspectableReader
- type Reader
- type ReaderCapabilities
- type ReaderInspection
- type StoreCandidate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverReader ¶
func DiscoverReader(root string, opts DiscoverOptions) (Reader, []StoreCandidate, error)
DiscoverReader finds the best supported discovered candidate and opens a reader for it.
func ExplainCandidate ¶
func ExplainCandidate(candidate StoreCandidate) string
func PotentialFutureAdapter ¶
func PotentialFutureAdapter(candidate StoreCandidate) bool
Types ¶
type CandidateKind ¶
type CandidateKind string
const ( KindUnknown CandidateKind = "unknown" KindSQLite CandidateKind = "sqlite" KindLevelDB CandidateKind = "leveldb" KindIndexedDB CandidateKind = "indexeddb" )
type CandidateSource ¶
type CandidateSource string
const ( SourceExplicit CandidateSource = "flag" SourceEnv CandidateSource = "env" SourceDefault CandidateSource = "default" SourceConfig CandidateSource = "config" SourceGlob CandidateSource = "glob" )
type DiscoverOptions ¶
type InspectableReader ¶
type InspectableReader interface {
Reader
Capabilities() ReaderCapabilities
Inspect() (ReaderInspection, error)
}
type Reader ¶
type Reader interface {
Candidate() StoreCandidate
OpenStore(opts db.StoreOptions) (*db.Store, error)
}
Reader abstracts a readable local store implementation. SQLite is the only concrete reader for now.
func OpenReader ¶
func OpenReader(candidate StoreCandidate) (Reader, error)
OpenReader instantiates a reader for a discovered local-store candidate.
type ReaderCapabilities ¶
type ReaderInspection ¶
type StoreCandidate ¶
type StoreCandidate struct {
Path string `json:"path"`
Kind CandidateKind `json:"kind"`
Source CandidateSource `json:"source"`
Confidence int `json:"confidence"`
Supported bool `json:"supported"`
}
func Discover ¶
func Discover(root string, opts DiscoverOptions) ([]StoreCandidate, error)
func ResolveCandidate ¶
func ResolveCandidate(root string, opts DiscoverOptions) (StoreCandidate, error)
ResolveCandidate finds the best supported discovered candidate.
Click to show internal directories.
Click to hide internal directories.