Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct { C config.Config D ds.ThreadSafeDatastore }
Mock is not thread-safe
func (*Mock) Datastore ¶
func (m *Mock) Datastore() ds.ThreadSafeDatastore
func (*Mock) GetConfigKey ¶
func (*Mock) SetConfigKey ¶
type OnlyOne ¶ added in v0.3.2
type OnlyOne struct {
// contains filtered or unexported fields
}
OnlyOne tracks open Repos by arbitrary key and returns the already open one.
func (*OnlyOne) Open ¶ added in v0.3.2
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.
Click to show internal directories.
Click to hide internal directories.