qri: github.com/qri-io/qri/repo/fs Index | Files

package fsrepo

import "github.com/qri-io/qri/repo/fs"

Package fsrepo is a file-system implementation of repo


Package Files

files.go fs.go migrate.go profile_store.go refstore.go


var ErrNotFound = fmt.Errorf("Not Found")

ErrNotFound is for when a qri profile isn't found

func Filepath Uses

func Filepath(rf File) string

Filepath gives the relative filepath to a repofiles in a given repository

func NewRepo Uses

func NewRepo(store cafs.Filestore, fsys qfs.Filesystem, book *logbook.Book, cache *dscache.Dscache, pro *profile.Profile, base string) (repo.Repo, error)

NewRepo creates a new file-based repository

Deprecated: use CreateRepo instead

type File Uses

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
    // FileInfo stores information about this repository
    // like version number, size of repo, etc.
    // FileConfig holds configuration specific to this repo
    // FileDatasets holds the list of datasets
    // FileEventLogs is a log of all queries in order they're run
    // FileJSONRefs is a file for the user's local namespace
    // No longer in use
    // FileDscache is a flatbuffer file of this repo's dataset cache
    // FileRefs is a flatbuffer file of this repo's dataset references
    // FilePeers holds peer repositories
    // Ideally this won't stick around for long
    // FileAnalytics holds analytics data
    // FileSearchIndex is the path to a search index
    // FileSelectedRefs is the path to the current ref selection
    // FileChangeRequests is a file of change requests

type ProfileStore Uses

type ProfileStore struct {
    // contains filtered or unexported fields

ProfileStore is an on-disk json file implementation of the repo.Peers interface

func NewProfileStore Uses

func NewProfileStore(bp basepath) *ProfileStore

NewProfileStore allocates a ProfileStore

func (*ProfileStore) DeleteProfile Uses

func (r *ProfileStore) DeleteProfile(id profile.ID) error

DeleteProfile removes a profile from the store

func (*ProfileStore) GetProfile Uses

func (r *ProfileStore) GetProfile(id profile.ID) (*profile.Profile, error)

GetProfile fetches a profile from the store

func (*ProfileStore) List Uses

func (r *ProfileStore) List() (map[profile.ID]*profile.Profile, error)

List hands back the list of peers

func (*ProfileStore) PeerIDs Uses

func (r *ProfileStore) PeerIDs(id profile.ID) ([]peer.ID, error)

PeerIDs gives the peer.IDs list for a given peername

func (*ProfileStore) PeerProfile Uses

func (r *ProfileStore) PeerProfile(id peer.ID) (*profile.Profile, error)

PeerProfile gives the profile that corresponds with a given peer.ID

func (*ProfileStore) PeernameID Uses

func (r *ProfileStore) PeernameID(peername string) (profile.ID, error)

PeernameID gives the profile.ID for a given peername

func (*ProfileStore) PutProfile Uses

func (r *ProfileStore) PutProfile(p *profile.Profile) error

PutProfile adds a peer to the store

type Refstore Uses

type Refstore struct {
    // contains filtered or unexported fields

Refstore is a file-based implementation of the Refstore interface. It stores names in a json file

func (Refstore) DeleteRef Uses

func (rs Refstore) DeleteRef(del reporef.DatasetRef) error

DeleteRef removes a name from the store

func (Refstore) GetRef Uses

func (rs Refstore) GetRef(get reporef.DatasetRef) (reporef.DatasetRef, error)

GetRef completes a partially-known reference

func (Refstore) PutRef Uses

func (rs Refstore) PutRef(r reporef.DatasetRef) (err error)

PutRef adds a reference to the store

func (Refstore) RefCount Uses

func (rs Refstore) RefCount() (int, error)

RefCount returns the size of the Refstore

func (Refstore) References Uses

func (rs Refstore) References(offset, limit int) ([]reporef.DatasetRef, error)

References gives a set of dataset references from the store

type Repo Uses

type Repo struct {
    // contains filtered or unexported fields

Repo is a filesystem-based implementation of the Repo interface

func (*Repo) Destroy Uses

func (r *Repo) Destroy() error

Destroy destroys this repository

func (*Repo) Dscache Uses

func (r *Repo) Dscache() *dscache.Dscache

Dscache returns a dscache

func (Repo) Filesystem Uses

func (r Repo) Filesystem() qfs.Filesystem

Filesystem returns this repo's Filesystem

func (*Repo) Logbook Uses

func (r *Repo) Logbook() *logbook.Book

Logbook stores operation logs for coordinating state across peers

func (Repo) Path Uses

func (r Repo) Path() string

Path returns the path to the root of the repo directory

func (*Repo) PrivateKey Uses

func (r *Repo) PrivateKey() crypto.PrivKey

PrivateKey returns this repo's private key

func (*Repo) Profile Uses

func (r *Repo) Profile() (*profile.Profile, error)

Profile gives this repo's peer profile

func (*Repo) Profiles Uses

func (r *Repo) Profiles() profile.Store

Profiles returns this repo's Peers implementation

func (*Repo) SetFilesystem Uses

func (r *Repo) SetFilesystem(fs qfs.Filesystem)

SetFilesystem implements QFSSetter, currently used during lib contstruction

func (*Repo) SetProfile Uses

func (r *Repo) SetProfile(p *profile.Profile) error

SetProfile updates this repo's peer profile info

func (Repo) Store Uses

func (r Repo) Store() cafs.Filestore

Store returns the underlying cafs.Filestore driving this repo

Package fsrepo imports 20 packages (graph) and is imported by 2 packages. Updated 2020-02-08. Refresh now. Tools for package owners.