schema

package
v0.0.0-...-575026b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package schema implements Schemas for blobcache volumes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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 None

type None struct{}

None is a Schema which does not impose any constraints on the contents of a volume.

func (None) Validate

func (None) Validate(ctx context.Context, s RO, prev, next []byte) error

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
	MaxSize() int
}

RO is read-only Store methods

type RW

type RW interface {
	RO
	Post(ctx context.Context, data []byte) (blobcache.CID, error)
}

RW is Read-Write Store methods

type RWD

type RWD interface {
	RW
	Delete(ctx context.Context, cids []blobcache.CID) error
}

RWD is Read-Write-Delete Store methods

type Schema

type Schema interface {
	// Validate returns nil if the contents of the volume are valid.
	Validate(ctx context.Context, s RO, prev, next []byte) error
}

Schema is the most general Schema type. All a Schema has to be able to do is validate the contents of a Volume.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL