Documentation ¶
Index ¶
- Variables
- func Init(repoPath string, conf *config.Config) error
- func IsInitialized(path string) bool
- func Open(repoPath string) (repo.Repo, error)
- type Datastore
- func (d *Datastore) Batch() (ds.Batch, error)
- func (d *Datastore) Close() error
- func (d *Datastore) CollectGarbage() error
- func (d *Datastore) Delete(key ds.Key) error
- func (d *Datastore) DiskUsage() (uint64, error)
- func (d *Datastore) Get(key ds.Key) (value []byte, err error)
- func (d *Datastore) GetExpiration(key ds.Key) (time.Time, error)
- func (d *Datastore) GetSize(key ds.Key) (size int, err error)
- func (d *Datastore) Has(key ds.Key) (bool, error)
- func (d *Datastore) NewTransaction(readOnly bool) (ds.Txn, error)
- func (d *Datastore) Put(key ds.Key, value []byte) error
- func (d *Datastore) PutWithTTL(key ds.Key, value []byte, ttl time.Duration) error
- func (d *Datastore) Query(q dsq.Query) (dsq.Results, error)
- func (d *Datastore) SetTTL(key ds.Key, ttl time.Duration) error
- type FSRepo
- type NoRepoError
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("datastore closed")
Functions ¶
func IsInitialized ¶
IsInitialized returns true if the repo is initialized at provided |path|.
Types ¶
type Datastore ¶
func NewDatastore ¶
NewDatastore creates a new badger datastore.
DO NOT set the Dir and/or ValuePath fields of opt, they will be set for you.
func (*Datastore) CollectGarbage ¶
func (*Datastore) DiskUsage ¶
DiskUsage implements the PersistentDatastore interface. It returns the sum of lsm and value log files sizes in bytes.
func (*Datastore) NewTransaction ¶
NewTransaction starts a new transaction. The resulting transaction object can be mutated without incurring changes to the underlying Datastore until the transaction is Committed.
func (*Datastore) PutWithTTL ¶
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 the current config. This function DOES NOT copy the config. The caller MUST NOT modify it without first calling `Clone`.
Result when not Open is undefined. The method may panic if it pleases.
type NoRepoError ¶
type NoRepoError struct {
Path string
}
func (NoRepoError) Error ¶
func (err NoRepoError) Error() string