Documentation
¶
Overview ¶
Package schema implements Schemas for blobcache volumes.
Index ¶
- func ExistsUnit(ctx context.Context, s Exists, cid blobcache.CID) (bool, error)
- type Change
- type Constructor
- type Exists
- type Factory
- type Initializer
- type KV
- type MemStore
- func (ms *MemStore) Delete(ctx context.Context, cids []blobcache.CID) error
- func (ms *MemStore) Exists(ctx context.Context, cids []blobcache.CID, dst []bool) error
- func (ms *MemStore) Get(ctx context.Context, cid blobcache.CID, buf []byte) (int, error)
- func (ms *MemStore) Hash(data []byte) blobcache.CID
- func (ms *MemStore) Len() int
- func (ms *MemStore) MaxSize() int
- func (ms *MemStore) Post(ctx context.Context, data []byte) (blobcache.CID, error)
- type None
- type RO
- type RW
- type Schema
- type Spec
- type Syncer
- type Value
- type VisitAll
- type WO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Constructor ¶
type Constructor = func(params json.RawMessage, mkSchema Factory) (Schema, error)
Constructor is a function that constructs a Schema from its parameters.
type Factory ¶
type Factory = func(blobcache.SchemaSpec) (Schema, error)
Factory creates a Schema from a Spec.
type Initializer ¶ added in v0.0.2
Initializer is an interface for Schemas which support initialization.
type KV ¶ added in v0.0.2
type KV[K, V any] interface { Put(ctx context.Context, s bcsdk.RW, root []byte, key K, value V) ([]byte, error) Get(ctx context.Context, s bcsdk.RO, root []byte, key K, dst *V) (bool, error) Delete(ctx context.Context, s bcsdk.RW, root []byte, key K) ([]byte, error) }
KV is an interface for Schemas which support common Key-Value operations.
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is a simple in-memory store, useful for testing. It has the same store methods as a transaction on an unsalted volume.
func NewTestStore ¶
type None ¶
type None struct{}
None is a Schema which does not impose any constraints on the contents of a volume.
type Schema ¶
type Schema interface {
// ValidateChange returns nil if the state transition is valid.
ValidateChange(ctx context.Context, change Change) error
}
Schema is the most general Schema type. All a Schema has to be able to do is validate the contents of a Volume.
func NoneConstructor ¶
func NoneConstructor(_ json.RawMessage, _ Factory) (Schema, error)
type Spec ¶
type Spec = blobcache.SchemaSpec
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bcfuse implements a filesystem interface for blobcache.
|
Package bcfuse implements a filesystem interface for blobcache. |
|
gitrh
package gitrh provides a Server implementation of the Git remote helper IPC protocol
|
package gitrh provides a Server implementation of the Git remote helper IPC protocol |
|
Package hydra implements a Mergeable Schema
|
Package hydra implements a Mergeable Schema |
|
Package jsonns provides a simple namespace implementation.
|
Package jsonns provides a simple namespace implementation. |
|
package ledger implements an append-only ledger where state transitions can be verified
|
package ledger implements an append-only ledger where state transitions can be verified |
Click to show internal directories.
Click to hide internal directories.