Documentation
¶
Index ¶
- Constants
- type Expr
- type FnBuilder
- func (fb *FnBuilder) ChangesOnBase(base Expr[gotfs.Root], changes []gotfs.Segment) Expr[gotfs.Segment]
- func (fb *FnBuilder) Concat(xs ...Expr[gotfs.Segment]) Expr[gotfs.Segment]
- func (fb *FnBuilder) FileMode(m fs.FileMode) Expr[fs.FileMode]
- func (fb *FnBuilder) Flush(ctx context.Context) (Function, error)
- func (fb *FnBuilder) Input(i uint32) Expr[gotfs.Root]
- func (fb *FnBuilder) MkdirAll(base Expr[gotfs.Root], p string, mode fs.FileMode) Expr[gotfs.Root]
- func (fb *FnBuilder) Nat(val uint32) Expr[uint32]
- func (fb *FnBuilder) Path(p string) Expr[string]
- func (fb *FnBuilder) Promote(x Expr[gotfs.Segment]) Expr[gotfs.Root]
- func (fb *FnBuilder) Root(root gotfs.Root) Expr[gotfs.Root]
- func (fb *FnBuilder) Segment(seg gotfs.Segment) Expr[gotfs.Segment]
- func (fb *FnBuilder) Select(root Expr[gotfs.Root], span gotkv.Span) Expr[gotfs.Segment]
- func (fb *FnBuilder) SetOutput(x Expr[gotfs.Root])
- func (fb *FnBuilder) Span(span gotfs.Span) Expr[gotfs.Span]
- type Function
- type I
- type Input
- type Machine
- type OpCode
- type TypeCode
- type Value
- type Value_Extent
- type Value_FileMode
- type Value_Info
- type Value_Nat
- type Value_Path
- type Value_Root
- type Value_Segment
- type Value_Span
- type Vertex
Constants ¶
const ( OpCode_UNKNOWN = 0 // OpCode_Nat produces a 32 bit Nat from 24 bits of data stored in the instruction. OpCode_Nat = 32 << 24 )
0-Arity
const ( // Input refers to a previoius commit by index // (index) -> (Root) // This Op reads from the entire input at the index. OpCode_Input // OpCode_Data loads from an index in the data table. // (index) -> (Value) OpCode_Data // Promote checks a segment for consistency and returns a root. // (Segment) -> Root OpCode_PROMOTE )
1-Arity
const ( // Select produces a segment from a Span within a Root // (Root, Span) -> (Segment) // This Op reads only from the Span within root. OpCode_SELECT // Concat takes 2 segments and concatenates them to produce a larger segment // ShiftOut shifts a segment out to a path // (Segment, Path) -> (Segment) OpCode_ShiftOut // ShiftIn shifts a segment by removing Path // It errors if not every path at that segment has Path as a prefix // (Segment, Path) -> (Segment) OpCode_ShiftIn // Pick produces a Root, taken from a specific path within another Root // (Root, Path) -> (Root) OpCode_PICK // (Segment, Segment) -> Segment OpCode_CONCAT )
2-Arity
const ( // Place takes a root, a path and a second root, and places the second root at that path in the first root. // The parent of that path must already exist in root. // (Root, Path, Root) -> Root OpCode_PLACE // MkdirAll creates the directory at path and any of its ancestors if necessary. // (Root, Path, FileMode) -> Root OpCode_MKDIRALL )
const ( Type_UNKNOWN = iota Type_Nat Type_Root Type_Segment Type_Span Type_Info Type_Extent Type_Path Type_FileMode )
const ISize = 4
ISize is the size of an insturction in bytes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Expr ¶
type Expr[T any] struct { // contains filtered or unexported fields }
Expr is a specification for a value to be computed. The type of the value is known ahead of time.
type FnBuilder ¶
type FnBuilder struct {
// contains filtered or unexported fields
}
func (*FnBuilder) ChangesOnBase ¶
func (*FnBuilder) Flush ¶
Flush creates a new Function and returns it. The data table is written, and then it and the program make up the rest of the function body. The function body is posted.
type Function ¶
type Function struct {
Ref gdat.Ref
// Arity is the number of inputs the function takes
Arity uint32
}
Function maps a []gotfs.Root to a gotfs.Root Function is a root expression, and the number of inputs it takes.
type I ¶
type I uint32
I is a single instruction, it represents a node in a computation DAG.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine holds configuration for operating on GotFS filesystems.
type OpCode ¶
type OpCode uint32
OpCode is just the arity and opcode bits. OpCode can be OR'd directly into an I to set the op and arity.
type Value_Extent ¶
Value_Extent is a reference to data
type Value_Info ¶
type Value_Root ¶
Value_Root is the root of a GotFS filesystem
type Value_Segment ¶
Value_Segment is a segment of a filesystem, not a valid filesystem on it's own.
type Value_Span ¶
Value_Span is a span within a filesystem