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

Index

Package Files

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

Variables

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, pro *profile.Profile, base string) (repo.Repo, error)

NewRepo creates a new file-based repository

type EventLog Uses

type EventLog struct {
    // contains filtered or unexported fields
}

EventLog is a file-based implementation of the repo.EventLog interface

func NewEventLog Uses

func NewEventLog(base string, file File, store cafs.Filestore) EventLog

NewEventLog allocates a new file-based EventLog instance

func (EventLog) Events Uses

func (ql EventLog) Events(limit, offset int) ([]*repo.Event, error)

Events fetches a set of Events from the store

func (EventLog) EventsSince Uses

func (ql EventLog) EventsSince(t time.Time) ([]*repo.Event, error)

EventsSince fetches a set of Events from the store that occur after a given timestamp

func (EventLog) LogEvent Uses

func (ql EventLog) LogEvent(t repo.EventType, ref repo.DatasetRef) error

LogEvent adds a Event to the store

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
    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 Uses

type ProfileStore struct {
    sync.Mutex
    // 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 repo.Refstore interface. It stores names in a json file

func (Refstore) DeleteRef Uses

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

DeleteRef removes a name from the store

func (Refstore) GetRef Uses

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

GetRef completes a partially-known reference

func (Refstore) PutRef Uses

func (rs Refstore) PutRef(r repo.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) ([]repo.DatasetRef, error)

References gives a set of dataset references from the store

type Repo Uses

type Repo struct {
    repo.Refstore
    EventLog
    // 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) Filesystem Uses

func (r Repo) Filesystem() qfs.Filesystem

Filesystem returns this repo's Filesystem

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) Search Uses

func (r *Repo) Search(ctx context.Context, p repo.SearchParams) ([]repo.DatasetRef, error)

Search this repo for dataset references

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

func (*Repo) UpdateSearchIndex Uses

func (r *Repo) UpdateSearchIndex(store cafs.Filestore) error

UpdateSearchIndex refreshes this repos search index

Package fsrepo imports 24 packages (graph) and is imported by 1 packages. Updated 2019-09-20. Refresh now. Tools for package owners.