Documentation ¶
Index ¶
- Variables
- type Datastore
- type Mock
- func (m *Mock) Close() error
- func (m *Mock) Config() (*config.Config, error)
- func (m *Mock) Datastore() Datastore
- func (m *Mock) GetConfigKey(key string) (interface{}, error)
- func (m *Mock) GetStorageUsage() (uint64, error)
- func (m *Mock) SetAPIAddr(addr string) error
- func (m *Mock) SetConfig(updated *config.Config) error
- func (m *Mock) SetConfigKey(key string, value interface{}) error
- type OnlyOne
- type Repo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrApiNotRunning = errors.New("api not running")
)
Functions ¶
This section is empty.
Types ¶
type Mock ¶
Mock is not thread-safe
func (*Mock) GetConfigKey ¶
func (*Mock) GetStorageUsage ¶
func (*Mock) SetAPIAddr ¶
func (*Mock) SetConfigKey ¶
type OnlyOne ¶
type OnlyOne struct {
// contains filtered or unexported fields
}
OnlyOne tracks open Repos by arbitrary key and returns the already open one.
func (*OnlyOne) Open ¶
Open a Repo identified by key. If Repo is not already open, the open function is called, and the result is remember for further use.
Key must be comparable, or Open will panic. Make sure to pick keys that are unique across different concrete Repo implementations, e.g. by creating a local type:
type repoKey string r, err := o.Open(repoKey(path), open)
Call Repo.Close when done.
type Repo ¶
type Repo interface { Config() (*config.Config, error) SetConfig(*config.Config) error SetConfigKey(key string, value interface{}) error GetConfigKey(key string) (interface{}, error) Datastore() Datastore GetStorageUsage() (uint64, error) // SetAPIAddr sets the API address in the repo. SetAPIAddr(addr string) error io.Closer }
Directories ¶
Path | Synopsis |
---|---|
package config implements the ipfs config file datastructures and utilities.
|
package config implements the ipfs config file datastructures and utilities. |
package fsrepo TODO explain the package roadmap...
|
package fsrepo TODO explain the package roadmap... |
Click to show internal directories.
Click to hide internal directories.