Documentation ¶
Overview ¶
package fsrepo
TODO explain the package roadmap...
.go-ipfs/ ├── client/ | ├── client.lock <------ protects client/ + signals its own pid │ ├── ipfs-client.cpuprof │ ├── ipfs-client.memprof │ └── logs/ ├── config ├── daemon/ │ ├── daemon.lock <------ protects daemon/ + signals its own address │ ├── ipfs-daemon.cpuprof │ ├── ipfs-daemon.memprof │ └── logs/ ├── datastore/ ├── repo.lock <------ protects datastore/ and config └── version
Index ¶
- func BestKnownPath() (string, error)
- func ConfigAt(repoPath string) (*config.Config, error)
- func Init(path string, conf *config.Config) error
- func IsInitialized(path string) bool
- func LockedByOtherProcess(repoPath string) bool
- func Remove(repoPath string) error
- type FSRepo
- func (r *FSRepo) Close() error
- func (r *FSRepo) Config() *config.Config
- func (r *FSRepo) Datastore() ds.ThreadSafeDatastore
- func (r *FSRepo) GetConfigKey(key string) (interface{}, error)
- func (r *FSRepo) Open() error
- func (r *FSRepo) SetConfig(updated *config.Config) error
- func (r *FSRepo) SetConfigKey(key string, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BestKnownPath ¶
BestKnownPath returns the best known fsrepo path. If the ENV override is present, this function returns that value. Otherwise, it returns the default repo path.
func ConfigAt ¶
ConfigAt returns an error if the FSRepo at the given path is not initialized. This function allows callers to read the config file even when another process is running and holding the lock.
func Init ¶
Init initializes a new FSRepo at the given path with the provided config. TODO add support for custom datastores.
func IsInitialized ¶
IsInitialized returns true if the repo is initialized at provided |path|.
func LockedByOtherProcess ¶
LockedByOtherProcess returns true if the FSRepo is locked by another process. If true, then the repo cannot be opened by this process.
Types ¶
type FSRepo ¶
type FSRepo struct {
// contains filtered or unexported fields
}
FSRepo represents an IPFS FileSystem Repo. It is safe for use by multiple callers.
func (*FSRepo) Config ¶
Config returns the FSRepo's config. This method must not be called if the repo is not open.
Result when not Open is undefined. The method may panic if it pleases.
func (*FSRepo) Datastore ¶
func (r *FSRepo) Datastore() ds.ThreadSafeDatastore
Datastore returns a repo-owned datastore. If FSRepo is Closed, return value is undefined.
func (*FSRepo) GetConfigKey ¶
GetConfigKey retrieves only the value of a particular key.
func (*FSRepo) SetConfigKey ¶
SetConfigKey writes the value of a particular key.