Documentation ¶
Index ¶
- Variables
- func Chooser(_ datamodel.Link, _ linking.LinkContext) (datamodel.NodePrototype, error)
- func NewBool(value bool) datamodel.Node
- func NewBytes(value []byte) datamodel.Node
- func NewBytesFromReader(rs io.ReadSeeker) datamodel.Node
- func NewFloat(value float64) datamodel.Node
- func NewInt(value int64) datamodel.Node
- func NewLink(value datamodel.Link) datamodel.Node
- func NewString(value string) datamodel.Node
- func NewUint(value uint64) datamodel.Node
- type Prototype__Any
- type Prototype__Bool
- type Prototype__Bytes
- type Prototype__Float
- type Prototype__Int
- type Prototype__Link
- type Prototype__List
- type Prototype__Map
- type Prototype__String
Constants ¶
This section is empty.
Variables ¶
View Source
var Prototype prototype
Prototype embeds a NodePrototype for every kind of Node implementation in this package. You can use it like this:
basicnode.Prototype.Map.NewBuilder().BeginMap() //...
and:
basicnode.Prototype.String.NewBuilder().AssignString("x") // ...
Most of the prototypes are for one particular Kind of node (e.g. string, int, etc); you can use the "Any" style if you want a builder that can accept any kind of data.
Functions ¶
func Chooser ¶
func Chooser(_ datamodel.Link, _ linking.LinkContext) (datamodel.NodePrototype, error)
Chooser implements traversal.LinkTargetNodePrototypeChooser.
It can be used directly when loading links into the "any" prototype, or with another chooser layer on top, such as:
prototypeChooser := dagpb.AddSupportToChooser(basicnode.Chooser)
func NewBytesFromReader ¶ added in v0.16.0
func NewBytesFromReader(rs io.ReadSeeker) datamodel.Node
Types ¶
type Prototype__Any ¶
type Prototype__Any struct{}
func (Prototype__Any) NewBuilder ¶
func (Prototype__Any) NewBuilder() datamodel.NodeBuilder
type Prototype__Bool ¶
type Prototype__Bool struct{}
func (Prototype__Bool) NewBuilder ¶
func (Prototype__Bool) NewBuilder() datamodel.NodeBuilder
type Prototype__Bytes ¶
type Prototype__Bytes struct{}
func (Prototype__Bytes) NewBuilder ¶
func (Prototype__Bytes) NewBuilder() datamodel.NodeBuilder
type Prototype__Float ¶
type Prototype__Float struct{}
func (Prototype__Float) NewBuilder ¶
func (Prototype__Float) NewBuilder() datamodel.NodeBuilder
type Prototype__Int ¶
type Prototype__Int struct{}
func (Prototype__Int) NewBuilder ¶
func (Prototype__Int) NewBuilder() datamodel.NodeBuilder
type Prototype__Link ¶
type Prototype__Link struct{}
func (Prototype__Link) NewBuilder ¶
func (Prototype__Link) NewBuilder() datamodel.NodeBuilder
type Prototype__List ¶
type Prototype__List struct{}
func (Prototype__List) NewBuilder ¶
func (Prototype__List) NewBuilder() datamodel.NodeBuilder
type Prototype__Map ¶
type Prototype__Map struct{}
func (Prototype__Map) NewBuilder ¶
func (Prototype__Map) NewBuilder() datamodel.NodeBuilder
type Prototype__String ¶
type Prototype__String struct{}
func (Prototype__String) NewBuilder ¶
func (Prototype__String) NewBuilder() datamodel.NodeBuilder
Click to show internal directories.
Click to hide internal directories.