Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link interface {
Prototype() LinkPrototype
}
type LinkContext ¶
type LinkPrototype ¶
type LinkPrototype interface { }
type ListBuilder ¶
type ListBuilder interface { }
type MapBuilder ¶
type MapBuilder interface { }
type Node ¶
type Node interface { Kind() Kind LookupByString(key string) (Node, error) LookupByNode(key Node) (Node, error) LookupByIndex(idx int) (Node, error) Length() int IsAbsent() bool IsNull() bool AsBool() (bool, error) AsInt() (int, error) AsFloat() (float64, error) AsString() (string, error) AsBytes() ([]byte, error) AsLink() (Link, error) Prototype() NodePrototype // note! replaces `NodeBuilder` method! }
type NodeBuilder ¶
type NodeBuilder interface { BeginMap() (MapBuilder, error) // note the "amend" options are gone -- now do it with feature detection on NodePrototypeSupportingAmend, instead! BeginList() (ListBuilder, error) // note the "amend" options are gone -- now do it with feature detection on NodePrototypeSupportingAmend, instead! CreateNull() (Node, error) CreateBool(bool) (Node, error) CreateInt(int) (Node, error) CreateFloat(float64) (Node, error) CreateString(string) (Node, error) CreateBytes([]byte) (Node, error) CreateLink(Link) (Node, error) // fixme this is dumb and all links should already be nodes; either that or their creation should hinge here, rather than elsewhere and be awkwardly doubled. Prototype() NodePrototype // it's unlikely this will often be needed, i think, but it's here nonetheless. (maybe generic transform will find this easier to use than the one on the node? i think both should end up in reach on the stack, but not sure.) }
all the error methods here are still a serious question. i don't really like them. you can 'must' them away, but... squick?
... we should make a muster that stores them somewhere rather than panics. or takes a type parameter for its panic, or `func(error) boxedError`. or something.
type NodePrototype ¶
type NodePrototype interface {
NewBuilder() NodeBuilder // allocs! (probably. sometimes the alloc is still later.)
}
Prototype is the information that lets you make more of them, and do some basic behavioral inspection; Type is the information that lets you understand how a group of nodes is related in a schema and rules it will follow.
type NodePrototypeSupportingAmend ¶
type NodePrototypeSupportingAmend interface {
AmendingBuilder(base Node) NodeBuilder
}
type StorageCommitter ¶
type StorageLoader ¶
type StorageWriter ¶
type StorageWriter func(ctx context.Context, lnkCtx LinkContext) (io.Writer, StorageCommitter, error)
Click to show internal directories.
Click to hide internal directories.