fsrepo

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package fsrepo is a file-system implementation of repo

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filepath

func Filepath(rf File) string

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

func NewRepo

func NewRepo(path string, fsys *muxfs.Mux, book *logbook.Book, cache *dscache.Dscache, pro profile.Store, bus event.Bus) (repo.Repo, error)

NewRepo creates a new file-based repository

Types

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
	// FileDscache is a flatbuffer file of this repo's dataset cache
	FileDscache
	// 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 Refstore added in v0.1.1

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 added in v0.1.1

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

DeleteRef removes a name from the store

func (Refstore) GetRef added in v0.1.1

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

GetRef completes a partially-known reference

func (Refstore) PutRef added in v0.1.1

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

PutRef adds a reference to the store

func (Refstore) RefCount added in v0.1.1

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

RefCount returns the size of the Refstore

func (Refstore) References added in v0.1.1

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

References gives a set of dataset references from the store

type Repo

type Repo struct {
	repo.Refstore
	// contains filtered or unexported fields
}

Repo is a filesystem-based implementation of the Repo interface

func (*Repo) Bus added in v0.9.10

func (r *Repo) Bus() event.Bus

Bus accesses the repo's bus

func (*Repo) Destroy

func (r *Repo) Destroy() error

Destroy destroys this repository

func (*Repo) Done added in v0.9.9

func (r *Repo) Done() <-chan struct{}

Done returns a channel that the repo will send on when the repo is finished closing

func (*Repo) DoneErr added in v0.9.9

func (r *Repo) DoneErr() error

DoneErr gives an error that occurred during the shutdown process

func (*Repo) Dscache added in v0.9.5

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

Dscache returns a dscache

func (*Repo) Filesystem added in v0.7.0

func (r *Repo) Filesystem() *muxfs.Mux

Filesystem returns this repo's Filesystem

func (*Repo) Logbook added in v0.9.1

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

Logbook stores operation logs for coordinating state across peers

func (*Repo) Path added in v0.8.0

func (r *Repo) Path() string

Path returns the path to the root of the repo directory

func (*Repo) Profiles added in v0.3.0

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

Profiles returns this repo's Peers implementation

func (*Repo) ResolveRef added in v0.9.9

func (r *Repo) ResolveRef(ctx context.Context, ref *dsref.Ref) (string, error)

ResolveRef implements the dsref.RefResolver interface

func (*Repo) SetFilesystem added in v0.8.0

func (r *Repo) SetFilesystem(fs *muxfs.Mux)

SetFilesystem implements QFSSetter, currently used during lib contstruction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL