Documentation ¶
Overview ¶
Package fsrepo is a file-system implementation of repo
Index ¶
- Variables
- func Filepath(rf File) string
- func NewRepo(store cafs.Filestore, fsys qfs.Filesystem, pro *profile.Profile, base string) (repo.Repo, error)
- type EventLog
- type File
- type ProfileStore
- func (r *ProfileStore) DeleteProfile(id profile.ID) error
- func (r *ProfileStore) GetProfile(id profile.ID) (*profile.Profile, error)
- func (r *ProfileStore) List() (map[profile.ID]*profile.Profile, error)
- func (r *ProfileStore) PeerIDs(id profile.ID) ([]peer.ID, error)
- func (r *ProfileStore) PeerProfile(id peer.ID) (*profile.Profile, error)
- func (r *ProfileStore) PeernameID(peername string) (profile.ID, error)
- func (r *ProfileStore) PutProfile(p *profile.Profile) error
- type Refstore
- func (rs Refstore) DeleteRef(del repo.DatasetRef) error
- func (rs Refstore) GetRef(get repo.DatasetRef) (repo.DatasetRef, error)
- func (rs Refstore) PutRef(r repo.DatasetRef) (err error)
- func (rs Refstore) RefCount() (int, error)
- func (rs Refstore) References(offset, limit int) ([]repo.DatasetRef, error)
- type Repo
- func (r *Repo) Destroy() error
- func (r Repo) Filesystem() qfs.Filesystem
- func (r Repo) Path() string
- func (r *Repo) PrivateKey() crypto.PrivKey
- func (r *Repo) Profile() (*profile.Profile, error)
- func (r *Repo) Profiles() profile.Store
- func (r *Repo) Search(p repo.SearchParams) ([]repo.DatasetRef, error)
- func (r *Repo) SetFilesystem(fs qfs.Filesystem)
- func (r *Repo) SetProfile(p *profile.Profile) error
- func (r Repo) Store() cafs.Filestore
- func (r *Repo) UpdateSearchIndex(store cafs.Filestore) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = fmt.Errorf("Not Found")
ErrNotFound is for when a qri profile isn't found
Functions ¶
Types ¶
type EventLog ¶ added in v0.3.0
type EventLog struct {
// contains filtered or unexported fields
}
EventLog is a file-based implementation of the repo.EventLog interface
func NewEventLog ¶ added in v0.3.0
NewEventLog allocates a new file-based EventLog instance
func (EventLog) EventsSince ¶ added in v0.3.0
EventsSince fetches a set of Events from the store that occur after a given timestamp
type File ¶
type File int
File represents a type file in a qri repository
const ( // FileUnknown makes the default file value invalid FileUnknown File = iota // FileLockfile is the on-disk mutex lock FileLockfile // FileInfo stores information about this repository // like version number, size of repo, etc. FileInfo // FileConfig holds configuration specific to this repo FileConfig // FileDatasets holds the list of datasets FileDatasets // FileEventLogs is a log of all queries in order they're run FileEventLogs // FileJSONRefs is a file for the user's local namespace // No longer in use FileJSONRefs // FileRefs is a flatbuffer file of this repo's dataset references FileRefs // FilePeers holds peer repositories // Ideally this won't stick around for long FilePeers // FileAnalytics holds analytics data FileAnalytics // FileSearchIndex is the path to a search index FileSearchIndex // FileSelectedRefs is the path to the current ref selection FileSelectedRefs // FileChangeRequests is a file of change requests FileChangeRequests )
type ProfileStore ¶ added in v0.3.0
ProfileStore is an on-disk json file implementation of the repo.Peers interface
func NewProfileStore ¶ added in v0.3.1
func NewProfileStore(bp basepath) *ProfileStore
NewProfileStore allocates a ProfileStore
func (*ProfileStore) DeleteProfile ¶ added in v0.3.0
func (r *ProfileStore) DeleteProfile(id profile.ID) error
DeleteProfile removes a profile from the store
func (*ProfileStore) GetProfile ¶ added in v0.3.0
GetProfile fetches a profile from the store
func (*ProfileStore) PeerIDs ¶ added in v0.3.0
func (r *ProfileStore) PeerIDs(id profile.ID) ([]peer.ID, error)
PeerIDs gives the peer.IDs list for a given peername
func (*ProfileStore) PeerProfile ¶ added in v0.3.0
func (r *ProfileStore) PeerProfile(id peer.ID) (*profile.Profile, error)
PeerProfile gives the profile that corresponds with a given peer.ID
func (*ProfileStore) PeernameID ¶ added in v0.3.0
func (r *ProfileStore) PeernameID(peername string) (profile.ID, error)
PeernameID gives the profile.ID for a given peername
func (*ProfileStore) PutProfile ¶ added in v0.3.0
func (r *ProfileStore) PutProfile(p *profile.Profile) error
PutProfile adds a peer to the store
type Refstore ¶ added in v0.1.1
type Refstore struct {
// contains filtered or unexported fields
}
Refstore is a file-based implementation of the repo.Refstore interface. It stores names in a json file
func (Refstore) DeleteRef ¶ added in v0.1.1
func (rs Refstore) DeleteRef(del repo.DatasetRef) error
DeleteRef removes a name from the store
func (Refstore) GetRef ¶ added in v0.1.1
func (rs Refstore) GetRef(get repo.DatasetRef) (repo.DatasetRef, error)
GetRef completes a partially-known reference
func (Refstore) PutRef ¶ added in v0.1.1
func (rs Refstore) PutRef(r repo.DatasetRef) (err error)
PutRef adds a reference to the store
func (Refstore) References ¶ added in v0.1.1
func (rs Refstore) References(offset, limit int) ([]repo.DatasetRef, error)
References gives a set of dataset references from the store
type Repo ¶
Repo is a filesystem-based implementation of the Repo interface
func (Repo) Filesystem ¶ added in v0.7.0
func (r Repo) Filesystem() qfs.Filesystem
Filesystem returns this repo's Filesystem
func (*Repo) PrivateKey ¶ added in v0.3.0
PrivateKey returns this repo's private key
func (*Repo) Search ¶
func (r *Repo) Search(p repo.SearchParams) ([]repo.DatasetRef, error)
Search this repo for dataset references
func (*Repo) SetFilesystem ¶ added in v0.8.0
func (r *Repo) SetFilesystem(fs qfs.Filesystem)
SetFilesystem implements QFSSetter, currently used during lib contstruction
func (*Repo) SetProfile ¶ added in v0.3.0
SetProfile updates this repo's peer profile info