Documentation
¶
Index ¶
- Constants
- Variables
- func CheckName(name string) error
- func CleanupVolume(ctx context.Context, vol Volume, info Info) error
- func ForEach(ctx context.Context, s Space, span Span, fn func(string) error) (retErr error)
- func IsExists(err error) bool
- func IsNotExist(err error) bool
- func SortAnnotations(s []Annotation)
- func Sync(ctx context.Context, src, dst *Mark, force bool) error
- func SyncSpaces(ctx context.Context, task SyncSpacesTask) error
- func TestSpace(t *testing.T, newSpace func(t testing.TB) Space)
- type Annotation
- type ChunkingConfig
- type Chunking_CDConfig
- type Chunking_Fixed
- type DSConfig
- type ErrInvalidName
- type FSConfig
- type FSMach
- type Info
- type Mark
- func (b *Mark) AsMetadata() Metadata
- func (m *Mark) Config() DSConfig
- func (b *Mark) GetTarget(ctx context.Context) (*Snap, Tx, error)
- func (b *Mark) GotFS() *gotfs.Machine
- func (b *Mark) GotVC() *VCMach
- func (b *Mark) History(ctx context.Context, fn func(ref gdat.Ref, snap Snap) error) error
- func (b *Mark) Modify(ctx context.Context, fn func(mctx ModifyCtx) (*Snap, error)) error
- func (b *Mark) SetTarget(ctx context.Context, src stores.Reading, snap Snap) error
- func (b *Mark) ViewFS(ctx context.Context, ...) error
- type MemSpace
- func (r *MemSpace) Create(ctx context.Context, name string, cfg Metadata) (*Info, error)
- func (r *MemSpace) Delete(ctx context.Context, name string) error
- func (r *MemSpace) Inspect(ctx context.Context, name string) (*Info, error)
- func (r *MemSpace) List(ctx context.Context, span Span, limit int) (ret []string, _ error)
- func (r *MemSpace) Open(ctx context.Context, name string) (*Mark, error)
- func (r *MemSpace) Set(ctx context.Context, name string, cfg Metadata) error
- type Metadata
- type ModifyCtx
- type Payload
- type Salt
- type Snap
- type SnapInfo
- type Space
- type Span
- type SyncSpacesTask
- type Tx
- type TxParams
- type VCMach
- type Volume
Constants ¶
View Source
const MaxNameLen = 1024
Variables ¶
View Source
var ( ErrNotExist = errors.New("mark does not exist") ErrExists = errors.New("a mark already exists by that name") )
Functions ¶
func CleanupVolume ¶
Cleanup ensures that there are no unreachable blobs in volume.
func ForEach ¶
ForEach is a convenience function which uses Space.List to call fn with all the mark names contained in span.
func IsNotExist ¶
func SortAnnotations ¶
func SortAnnotations(s []Annotation)
func SyncSpaces ¶
func SyncSpaces(ctx context.Context, task SyncSpacesTask) error
Types ¶
type Annotation ¶
Annotation annotates a mark
func GetAnnotation ¶
func GetAnnotation(as []Annotation, key string) (ret []Annotation)
type ChunkingConfig ¶
type ChunkingConfig struct {
CD *Chunking_CDConfig `json:"cd,omitempty"`
Max *Chunking_Fixed `json:"fixed,omitempty"`
}
type Chunking_CDConfig ¶
type Chunking_Fixed ¶
type DSConfig ¶
type DSConfig struct {
// Salt is a 32-byte salt used to derive the cryptographic keys for the mark.
Salt Salt `json:"salt"`
// GotFS contains all configuration for GotFS
GotFS FSConfig `json:"fs"`
}
DSConfig holds all data structure parameters
func DefaultConfig ¶
type ErrInvalidName ¶
func (ErrInvalidName) Error ¶
func (e ErrInvalidName) Error() string
type FSConfig ¶
type FSConfig struct {
Data ChunkingConfig `json:"data_chunking"`
Metadata Chunking_CDConfig `json:"metadata_chunking"`
}
Config contains all parameters.
type Info ¶
type Info struct {
// Config holds the all the datastructure parameters
Config DSConfig `json:"config"`
// Annotations are arbitrary metadata associated with the mark.
Annotations []Annotation `json:"annotations"`
// CreatedAt is the time the mark was created.
CreatedAt tai64.TAI64 `json:"created_at"`
}
Info is the metadata associated with a Mark.
func CreateIfNotExists ¶
func (Info) AsMetadata ¶
type Mark ¶
Mark associates metadata with a Volume.
func (*Mark) AsMetadata ¶
type MemSpace ¶
type MemSpace struct {
// contains filtered or unexported fields
}
type Metadata ¶
type Metadata struct {
Config DSConfig `json:"config"`
Annotations []Annotation `json:"annotations"`
}
Metadata is non-volume, user-modifiable information associated with a mark.
type Salt ¶
type Salt [32]byte
Salt is a 32-byte salt
func (Salt) MarshalText ¶
func (*Salt) UnmarshalText ¶
type SnapInfo ¶
type SnapInfo struct {
AuthoredAt tai64.TAI64 `json:"authored_at"`
Authors []inet256.ID `json:"authors"`
Message string `json:"message"`
}
SnapInfo holds additional information about a snapshot. This is stored as json in the snapshot.
type Space ¶
type Space interface {
Create(ctx context.Context, name string, cfg Metadata) (*Info, error)
Inspect(ctx context.Context, name string) (*Info, error)
Set(ctx context.Context, name string, cfg Metadata) error
Delete(ctx context.Context, name string) error
List(ctx context.Context, span Span, limit int) ([]string, error)
// Open returns a volume for viewing and modifying the mark contents.
Open(ctx context.Context, name string) (*Mark, error)
}
A Space holds named marks.
type SyncSpacesTask ¶
type SyncSpacesTask struct {
// Src is the space to read from.
Src Space
// Dst is the name ofthe space to write to.
Dst Space
// Filter is applied to src to determine what to copy.
// If nil, then all marks are copied.
Filter func(string) bool
// MapName is applied to go from names in the Src space, to name in the Dst space.
MapName func(string) string
}
SyncSpacesTask contains parameters needed to copy marks from one space to another.
Click to show internal directories.
Click to hide internal directories.