Documentation
¶
Overview ¶
Package schema implements Schemas for blobcache volumes.
Index ¶
- type Change
- type Constructor
- type Container
- type Factory
- type Link
- 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 RWD
- type Schema
- type Spec
- type WO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 Container ¶
type Container interface { Schema // ReadLinks returns a list of links for a given root. ReadLinks(ctx context.Context, s RO, root []byte, dst map[blobcache.OID]blobcache.ActionSet) error }
Container is a Schema which can store Links to other volumes.
type Factory ¶
type Factory = func(blobcache.SchemaSpec) (Schema, error)
Factory creates a Schema from a Spec.
type Link ¶
type Link struct { // Target is the OID of the volume being referenced. Target blobcache.OID // Rights are the set of actions on the target, which are granted to the caller. Rights blobcache.ActionSet }
Link is a reference from one volume to another.
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.
type None ¶
type None struct{}
None is a Schema which does not impose any constraints on the contents of a volume.
type RO ¶
type RO interface { Get(ctx context.Context, cid blobcache.CID, buf []byte) (int, error) Exists(ctx context.Context, cids []blobcache.CID, dst []bool) error Hash(data []byte) blobcache.CID MaxSize() int }
RO is read-only Store methods
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 basiccont implements a simple container for volumes.
|
Package basiccont implements a simple container for volumes. |
Package basicns provides a simple namespace implementation.
|
Package basicns provides a simple namespace implementation. |
package schematests provides a test suite for schemas.
|
package schematests provides a test suite for schemas. |