caps

package module
v0.0.0-...-f3884c4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: MIT Imports: 2 Imported by: 0

README

Go code generator for Capnproto definitions. It integrates MsgPack and Capn'proto code generators. Code generation options available as annotations. Also this tool adds support for possible data validation.

HOW TO

You need Go 1.5 version. Set environment variable: GO15VENDOREXPERIMENT=1.

  1. Install capnp tool. See Instructions

  2. Install caps

    go get github.com/tpukep/caps/...
    
  3. Write Capn'proto schema model.capnp:

    @0xad8d3cbc6db52a1d;
    
    using Go = import "/go.capnp";
    $Go.package("model");
    
    struct Book {
       title      @0:   Text;
       pageCount  @1:   Int32;
       authors    @2:   List(Text);
       content    @3:   Text;
    }
    
  4. Generate Go plain code.

    caps -source model.capnp
    

Annotations

Codecs

using Codec = import "/caps/codec.capnp";

# By default only plain Go code will be generated
# These annotations are enable extra features

$Codec.msgp;  # Enables msgp code generation
$Codec.json;  # Enables go json tags generation in plain Go code
$Codec.capnp; # Enables Capn'proto code generation

struct Person {
   name  @0 :Text;
   email @1 :Text;
   age   @2 :UInt8;
   phone @3 :Text;
}

Fields

using Field = import "/caps/field.capnp";

struct Person {
   firstName  @0 :Text $Field.required("name"); # Rename field to use more
                                                # compact name in serialization code
   email @1 :Text;
   age   @2 :UInt8 $Field.optional("pc");      # Mark as optional
   phone @3 :Text $Field.ignored;              # This field will be ignored
}

Checks

You can use Go-playground Validator expressions to generate tags in plain Go code. Note that $Field tags also generate corresponding validate tags.

Example of various checks
using Check = import "/caps/check.capnp";

struct Person $Go.doc("Some Person") {
   name  @0 :Text  $Check.value("max=256,min=2");
   email @1 :Text  $Check.value("email");
   age   @2 :UInt8 $Check.value("max=40");
   phone @3 :Text;
}

Examples of use located at demo/annotations.capnp.

Documentation

Index

Constants

View Source
const CheckValue = uint64(0x8c5f56d06a1e0074)
View Source
const CodecCapnp = uint64(0x97e981fc97bd1f9e)
View Source
const CodecJson = uint64(0xd44ac70dbe18c0dc)
View Source
const CodecMsgp = uint64(0xdd7630a67673d856)
View Source
const FieldIgnored = uint64(0xbd6ce89716d84707)
View Source
const (
	FieldNoDiscriminant = uint16(65535)
)
View Source
const FieldOptional = uint64(0xad97186ee95a88b9)
View Source
const FieldRequired = uint64(0xd7a496b371b3cf32)

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation C.Struct

func AutoNewAnnotation

func AutoNewAnnotation(s *C.Segment) Annotation

func NewAnnotation

func NewAnnotation(s *C.Segment) Annotation

func NewRootAnnotation

func NewRootAnnotation(s *C.Segment) Annotation

func ReadRootAnnotation

func ReadRootAnnotation(s *C.Segment) Annotation

func (Annotation) Brand

func (s Annotation) Brand() Brand

func (Annotation) Id

func (s Annotation) Id() uint64

func (Annotation) MarshalJSON

func (s Annotation) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Annotation) SetBrand

func (s Annotation) SetBrand(v Brand)

func (Annotation) SetId

func (s Annotation) SetId(v uint64)

func (Annotation) SetValue

func (s Annotation) SetValue(v Value)

func (Annotation) Value

func (s Annotation) Value() Value

type Annotation_List

type Annotation_List C.PointerList

func NewAnnotationList

func NewAnnotationList(s *C.Segment, sz int) Annotation_List

func (Annotation_List) At

func (s Annotation_List) At(i int) Annotation

func (Annotation_List) Len

func (s Annotation_List) Len() int

func (Annotation_List) Set

func (s Annotation_List) Set(i int, item Annotation)

func (Annotation_List) ToArray

func (s Annotation_List) ToArray() []Annotation

type Brand

type Brand C.Struct

func AutoNewBrand

func AutoNewBrand(s *C.Segment) Brand

func NewBrand

func NewBrand(s *C.Segment) Brand

func NewRootBrand

func NewRootBrand(s *C.Segment) Brand

func ReadRootBrand

func ReadRootBrand(s *C.Segment) Brand

func (Brand) MarshalJSON

func (s Brand) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Brand) Scopes

func (s Brand) Scopes() BrandScope_List

func (Brand) SetScopes

func (s Brand) SetScopes(v BrandScope_List)

type BrandBinding

type BrandBinding C.Struct

func AutoNewBrandBinding

func AutoNewBrandBinding(s *C.Segment) BrandBinding

func NewBrandBinding

func NewBrandBinding(s *C.Segment) BrandBinding

func NewRootBrandBinding

func NewRootBrandBinding(s *C.Segment) BrandBinding

func ReadRootBrandBinding

func ReadRootBrandBinding(s *C.Segment) BrandBinding

func (BrandBinding) MarshalJSON

func (s BrandBinding) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (BrandBinding) SetType

func (s BrandBinding) SetType(v Type)

func (BrandBinding) SetUnbound

func (s BrandBinding) SetUnbound()

func (BrandBinding) Type

func (s BrandBinding) Type() Type

func (BrandBinding) Which

func (s BrandBinding) Which() BrandBinding_Which

type BrandBinding_List

type BrandBinding_List C.PointerList

func NewBrandBindingList

func NewBrandBindingList(s *C.Segment, sz int) BrandBinding_List

func (BrandBinding_List) At

func (BrandBinding_List) Len

func (s BrandBinding_List) Len() int

func (BrandBinding_List) Set

func (s BrandBinding_List) Set(i int, item BrandBinding)

func (BrandBinding_List) ToArray

func (s BrandBinding_List) ToArray() []BrandBinding

type BrandBinding_Which

type BrandBinding_Which uint16
const (
	BRANDBINDING_UNBOUND BrandBinding_Which = 0
	BRANDBINDING_TYPE    BrandBinding_Which = 1
)

type BrandScope

type BrandScope C.Struct

func AutoNewBrandScope

func AutoNewBrandScope(s *C.Segment) BrandScope

func NewBrandScope

func NewBrandScope(s *C.Segment) BrandScope

func NewRootBrandScope

func NewRootBrandScope(s *C.Segment) BrandScope

func ReadRootBrandScope

func ReadRootBrandScope(s *C.Segment) BrandScope

func (BrandScope) Bind

func (s BrandScope) Bind() BrandBinding_List

func (BrandScope) MarshalJSON

func (s BrandScope) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (BrandScope) ScopeId

func (s BrandScope) ScopeId() uint64

func (BrandScope) SetBind

func (s BrandScope) SetBind(v BrandBinding_List)

func (BrandScope) SetInherit

func (s BrandScope) SetInherit()

func (BrandScope) SetScopeId

func (s BrandScope) SetScopeId(v uint64)

func (BrandScope) Which

func (s BrandScope) Which() BrandScope_Which

type BrandScope_List

type BrandScope_List C.PointerList

func NewBrandScopeList

func NewBrandScopeList(s *C.Segment, sz int) BrandScope_List

func (BrandScope_List) At

func (s BrandScope_List) At(i int) BrandScope

func (BrandScope_List) Len

func (s BrandScope_List) Len() int

func (BrandScope_List) Set

func (s BrandScope_List) Set(i int, item BrandScope)

func (BrandScope_List) ToArray

func (s BrandScope_List) ToArray() []BrandScope

type BrandScope_Which

type BrandScope_Which uint16
const (
	BRANDSCOPE_BIND    BrandScope_Which = 0
	BRANDSCOPE_INHERIT BrandScope_Which = 1
)

type Brand_List

type Brand_List C.PointerList

func NewBrandList

func NewBrandList(s *C.Segment, sz int) Brand_List

func (Brand_List) At

func (s Brand_List) At(i int) Brand

func (Brand_List) Len

func (s Brand_List) Len() int

func (Brand_List) Set

func (s Brand_List) Set(i int, item Brand)

func (Brand_List) ToArray

func (s Brand_List) ToArray() []Brand

type CodeGeneratorRequest

type CodeGeneratorRequest C.Struct

func AutoNewCodeGeneratorRequest

func AutoNewCodeGeneratorRequest(s *C.Segment) CodeGeneratorRequest

func NewCodeGeneratorRequest

func NewCodeGeneratorRequest(s *C.Segment) CodeGeneratorRequest

func NewRootCodeGeneratorRequest

func NewRootCodeGeneratorRequest(s *C.Segment) CodeGeneratorRequest

func ReadRootCodeGeneratorRequest

func ReadRootCodeGeneratorRequest(s *C.Segment) CodeGeneratorRequest

func (CodeGeneratorRequest) MarshalJSON

func (s CodeGeneratorRequest) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (CodeGeneratorRequest) Nodes

func (s CodeGeneratorRequest) Nodes() Node_List

func (CodeGeneratorRequest) RequestedFiles

func (CodeGeneratorRequest) SetNodes

func (s CodeGeneratorRequest) SetNodes(v Node_List)

func (CodeGeneratorRequest) SetRequestedFiles

type CodeGeneratorRequestRequestedFile

type CodeGeneratorRequestRequestedFile C.Struct

func AutoNewCodeGeneratorRequestRequestedFile

func AutoNewCodeGeneratorRequestRequestedFile(s *C.Segment) CodeGeneratorRequestRequestedFile

func NewCodeGeneratorRequestRequestedFile

func NewCodeGeneratorRequestRequestedFile(s *C.Segment) CodeGeneratorRequestRequestedFile

func NewRootCodeGeneratorRequestRequestedFile

func NewRootCodeGeneratorRequestRequestedFile(s *C.Segment) CodeGeneratorRequestRequestedFile

func ReadRootCodeGeneratorRequestRequestedFile

func ReadRootCodeGeneratorRequestRequestedFile(s *C.Segment) CodeGeneratorRequestRequestedFile

func (CodeGeneratorRequestRequestedFile) Filename

func (CodeGeneratorRequestRequestedFile) Id

func (CodeGeneratorRequestRequestedFile) Imports

func (CodeGeneratorRequestRequestedFile) MarshalJSON

func (s CodeGeneratorRequestRequestedFile) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (CodeGeneratorRequestRequestedFile) SetFilename

func (s CodeGeneratorRequestRequestedFile) SetFilename(v string)

func (CodeGeneratorRequestRequestedFile) SetId

func (CodeGeneratorRequestRequestedFile) SetImports

type CodeGeneratorRequestRequestedFileImport

type CodeGeneratorRequestRequestedFileImport C.Struct

func AutoNewCodeGeneratorRequestRequestedFileImport

func AutoNewCodeGeneratorRequestRequestedFileImport(s *C.Segment) CodeGeneratorRequestRequestedFileImport

func NewCodeGeneratorRequestRequestedFileImport

func NewCodeGeneratorRequestRequestedFileImport(s *C.Segment) CodeGeneratorRequestRequestedFileImport

func NewRootCodeGeneratorRequestRequestedFileImport

func NewRootCodeGeneratorRequestRequestedFileImport(s *C.Segment) CodeGeneratorRequestRequestedFileImport

func ReadRootCodeGeneratorRequestRequestedFileImport

func ReadRootCodeGeneratorRequestRequestedFileImport(s *C.Segment) CodeGeneratorRequestRequestedFileImport

func (CodeGeneratorRequestRequestedFileImport) Id

func (CodeGeneratorRequestRequestedFileImport) MarshalJSON

func (s CodeGeneratorRequestRequestedFileImport) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (CodeGeneratorRequestRequestedFileImport) Name

func (CodeGeneratorRequestRequestedFileImport) SetId

func (CodeGeneratorRequestRequestedFileImport) SetName

type CodeGeneratorRequestRequestedFileImport_List

type CodeGeneratorRequestRequestedFileImport_List C.PointerList

func NewCodeGeneratorRequestRequestedFileImportList

func NewCodeGeneratorRequestRequestedFileImportList(s *C.Segment, sz int) CodeGeneratorRequestRequestedFileImport_List

func (CodeGeneratorRequestRequestedFileImport_List) At

func (CodeGeneratorRequestRequestedFileImport_List) Len

func (CodeGeneratorRequestRequestedFileImport_List) Set

func (CodeGeneratorRequestRequestedFileImport_List) ToArray

type CodeGeneratorRequestRequestedFile_List

type CodeGeneratorRequestRequestedFile_List C.PointerList

func NewCodeGeneratorRequestRequestedFileList

func NewCodeGeneratorRequestRequestedFileList(s *C.Segment, sz int) CodeGeneratorRequestRequestedFile_List

func (CodeGeneratorRequestRequestedFile_List) At

func (CodeGeneratorRequestRequestedFile_List) Len

func (CodeGeneratorRequestRequestedFile_List) Set

func (CodeGeneratorRequestRequestedFile_List) ToArray

type CodeGeneratorRequest_List

type CodeGeneratorRequest_List C.PointerList

func NewCodeGeneratorRequestList

func NewCodeGeneratorRequestList(s *C.Segment, sz int) CodeGeneratorRequest_List

func (CodeGeneratorRequest_List) At

func (CodeGeneratorRequest_List) Len

func (CodeGeneratorRequest_List) Set

func (CodeGeneratorRequest_List) ToArray

type ElementSize

type ElementSize uint16
const (
	ELEMENTSIZE_EMPTY           ElementSize = 0
	ELEMENTSIZE_BIT             ElementSize = 1
	ELEMENTSIZE_BYTE            ElementSize = 2
	ELEMENTSIZE_TWOBYTES        ElementSize = 3
	ELEMENTSIZE_FOURBYTES       ElementSize = 4
	ELEMENTSIZE_EIGHTBYTES      ElementSize = 5
	ELEMENTSIZE_POINTER         ElementSize = 6
	ELEMENTSIZE_INLINECOMPOSITE ElementSize = 7
)

func ElementSizeFromString

func ElementSizeFromString(c string) ElementSize

func (ElementSize) MarshalJSON

func (s ElementSize) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (ElementSize) String

func (c ElementSize) String() string

type ElementSize_List

type ElementSize_List C.PointerList

func NewElementSizeList

func NewElementSizeList(s *C.Segment, sz int) ElementSize_List

func (ElementSize_List) At

func (ElementSize_List) Len

func (s ElementSize_List) Len() int

func (ElementSize_List) ToArray

func (s ElementSize_List) ToArray() []ElementSize

type Enumerant

type Enumerant C.Struct

func AutoNewEnumerant

func AutoNewEnumerant(s *C.Segment) Enumerant

func NewEnumerant

func NewEnumerant(s *C.Segment) Enumerant

func NewRootEnumerant

func NewRootEnumerant(s *C.Segment) Enumerant

func ReadRootEnumerant

func ReadRootEnumerant(s *C.Segment) Enumerant

func (Enumerant) Annotations

func (s Enumerant) Annotations() Annotation_List

func (Enumerant) CodeOrder

func (s Enumerant) CodeOrder() uint16

func (Enumerant) MarshalJSON

func (s Enumerant) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Enumerant) Name

func (s Enumerant) Name() string

func (Enumerant) SetAnnotations

func (s Enumerant) SetAnnotations(v Annotation_List)

func (Enumerant) SetCodeOrder

func (s Enumerant) SetCodeOrder(v uint16)

func (Enumerant) SetName

func (s Enumerant) SetName(v string)

type Enumerant_List

type Enumerant_List C.PointerList

func NewEnumerantList

func NewEnumerantList(s *C.Segment, sz int) Enumerant_List

func (Enumerant_List) At

func (s Enumerant_List) At(i int) Enumerant

func (Enumerant_List) Len

func (s Enumerant_List) Len() int

func (Enumerant_List) Set

func (s Enumerant_List) Set(i int, item Enumerant)

func (Enumerant_List) ToArray

func (s Enumerant_List) ToArray() []Enumerant

type Field

type Field C.Struct

func AutoNewField

func AutoNewField(s *C.Segment) Field

func NewField

func NewField(s *C.Segment) Field

func NewRootField

func NewRootField(s *C.Segment) Field

func ReadRootField

func ReadRootField(s *C.Segment) Field

func (Field) Annotations

func (s Field) Annotations() Annotation_List

func (Field) CodeOrder

func (s Field) CodeOrder() uint16

func (Field) DiscriminantValue

func (s Field) DiscriminantValue() uint16

func (Field) Group

func (s Field) Group() FieldGroup

func (Field) MarshalJSON

func (s Field) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Field) Name

func (s Field) Name() string

func (Field) Ordinal

func (s Field) Ordinal() FieldOrdinal

func (Field) SetAnnotations

func (s Field) SetAnnotations(v Annotation_List)

func (Field) SetCodeOrder

func (s Field) SetCodeOrder(v uint16)

func (Field) SetDiscriminantValue

func (s Field) SetDiscriminantValue(v uint16)

func (Field) SetGroup

func (s Field) SetGroup()

func (Field) SetName

func (s Field) SetName(v string)

func (Field) SetSlot

func (s Field) SetSlot()

func (Field) Slot

func (s Field) Slot() FieldSlot

func (Field) Which

func (s Field) Which() Field_Which

type FieldGroup

type FieldGroup Field

func (FieldGroup) SetTypeId

func (s FieldGroup) SetTypeId(v uint64)

func (FieldGroup) TypeId

func (s FieldGroup) TypeId() uint64

type FieldOrdinal

type FieldOrdinal Field

func (FieldOrdinal) Explicit

func (s FieldOrdinal) Explicit() uint16

func (FieldOrdinal) SetExplicit

func (s FieldOrdinal) SetExplicit(v uint16)

func (FieldOrdinal) SetImplicit

func (s FieldOrdinal) SetImplicit()

func (FieldOrdinal) Which

func (s FieldOrdinal) Which() FieldOrdinal_Which

type FieldOrdinal_Which

type FieldOrdinal_Which uint16
const (
	FIELDORDINAL_IMPLICIT FieldOrdinal_Which = 0
	FIELDORDINAL_EXPLICIT FieldOrdinal_Which = 1
)

type FieldSlot

type FieldSlot Field

func (FieldSlot) DefaultValue

func (s FieldSlot) DefaultValue() Value

func (FieldSlot) HadExplicitDefault

func (s FieldSlot) HadExplicitDefault() bool

func (FieldSlot) Offset

func (s FieldSlot) Offset() uint32

func (FieldSlot) SetDefaultValue

func (s FieldSlot) SetDefaultValue(v Value)

func (FieldSlot) SetHadExplicitDefault

func (s FieldSlot) SetHadExplicitDefault(v bool)

func (FieldSlot) SetOffset

func (s FieldSlot) SetOffset(v uint32)

func (FieldSlot) SetType

func (s FieldSlot) SetType(v Type)

func (FieldSlot) Type

func (s FieldSlot) Type() Type

type Field_List

type Field_List C.PointerList

func NewFieldList

func NewFieldList(s *C.Segment, sz int) Field_List

func (Field_List) At

func (s Field_List) At(i int) Field

func (Field_List) Len

func (s Field_List) Len() int

func (Field_List) Set

func (s Field_List) Set(i int, item Field)

func (Field_List) ToArray

func (s Field_List) ToArray() []Field

type Field_Which

type Field_Which uint16
const (
	FIELD_SLOT  Field_Which = 0
	FIELD_GROUP Field_Which = 1
)

type Method

type Method C.Struct

func AutoNewMethod

func AutoNewMethod(s *C.Segment) Method

func NewMethod

func NewMethod(s *C.Segment) Method

func NewRootMethod

func NewRootMethod(s *C.Segment) Method

func ReadRootMethod

func ReadRootMethod(s *C.Segment) Method

func (Method) Annotations

func (s Method) Annotations() Annotation_List

func (Method) CodeOrder

func (s Method) CodeOrder() uint16

func (Method) ImplicitParameters

func (s Method) ImplicitParameters() NodeParameter_List

func (Method) MarshalJSON

func (s Method) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Method) Name

func (s Method) Name() string

func (Method) ParamBrand

func (s Method) ParamBrand() Brand

func (Method) ParamStructType

func (s Method) ParamStructType() uint64

func (Method) ResultBrand

func (s Method) ResultBrand() Brand

func (Method) ResultStructType

func (s Method) ResultStructType() uint64

func (Method) SetAnnotations

func (s Method) SetAnnotations(v Annotation_List)

func (Method) SetCodeOrder

func (s Method) SetCodeOrder(v uint16)

func (Method) SetImplicitParameters

func (s Method) SetImplicitParameters(v NodeParameter_List)

func (Method) SetName

func (s Method) SetName(v string)

func (Method) SetParamBrand

func (s Method) SetParamBrand(v Brand)

func (Method) SetParamStructType

func (s Method) SetParamStructType(v uint64)

func (Method) SetResultBrand

func (s Method) SetResultBrand(v Brand)

func (Method) SetResultStructType

func (s Method) SetResultStructType(v uint64)

type Method_List

type Method_List C.PointerList

func NewMethodList

func NewMethodList(s *C.Segment, sz int) Method_List

func (Method_List) At

func (s Method_List) At(i int) Method

func (Method_List) Len

func (s Method_List) Len() int

func (Method_List) Set

func (s Method_List) Set(i int, item Method)

func (Method_List) ToArray

func (s Method_List) ToArray() []Method

type Node

type Node C.Struct

func AutoNewNode

func AutoNewNode(s *C.Segment) Node

func NewNode

func NewNode(s *C.Segment) Node

func NewRootNode

func NewRootNode(s *C.Segment) Node

func ReadRootNode

func ReadRootNode(s *C.Segment) Node

func (Node) Annotation

func (s Node) Annotation() NodeAnnotation

func (Node) Annotations

func (s Node) Annotations() Annotation_List

func (Node) Const

func (s Node) Const() NodeConst

func (Node) DisplayName

func (s Node) DisplayName() string

func (Node) DisplayNamePrefixLength

func (s Node) DisplayNamePrefixLength() uint32

func (Node) Enum

func (s Node) Enum() NodeEnum

func (Node) Id

func (s Node) Id() uint64

func (Node) Interface

func (s Node) Interface() NodeInterface

func (Node) IsGeneric

func (s Node) IsGeneric() bool

func (Node) MarshalJSON

func (s Node) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Node) NestedNodes

func (s Node) NestedNodes() NodeNestedNode_List

func (Node) Parameters

func (s Node) Parameters() NodeParameter_List

func (Node) ScopeId

func (s Node) ScopeId() uint64

func (Node) SetAnnotation

func (s Node) SetAnnotation()

func (Node) SetAnnotations

func (s Node) SetAnnotations(v Annotation_List)

func (Node) SetConst

func (s Node) SetConst()

func (Node) SetDisplayName

func (s Node) SetDisplayName(v string)

func (Node) SetDisplayNamePrefixLength

func (s Node) SetDisplayNamePrefixLength(v uint32)

func (Node) SetEnum

func (s Node) SetEnum()

func (Node) SetFile

func (s Node) SetFile()

func (Node) SetId

func (s Node) SetId(v uint64)

func (Node) SetInterface

func (s Node) SetInterface()

func (Node) SetIsGeneric

func (s Node) SetIsGeneric(v bool)

func (Node) SetNestedNodes

func (s Node) SetNestedNodes(v NodeNestedNode_List)

func (Node) SetParameters

func (s Node) SetParameters(v NodeParameter_List)

func (Node) SetScopeId

func (s Node) SetScopeId(v uint64)

func (Node) SetStruct

func (s Node) SetStruct()

func (Node) Struct

func (s Node) Struct() NodeStruct

func (Node) Which

func (s Node) Which() Node_Which

type NodeAnnotation

type NodeAnnotation Node

func (NodeAnnotation) SetTargetsAnnotation

func (s NodeAnnotation) SetTargetsAnnotation(v bool)

func (NodeAnnotation) SetTargetsConst

func (s NodeAnnotation) SetTargetsConst(v bool)

func (NodeAnnotation) SetTargetsEnum

func (s NodeAnnotation) SetTargetsEnum(v bool)

func (NodeAnnotation) SetTargetsEnumerant

func (s NodeAnnotation) SetTargetsEnumerant(v bool)

func (NodeAnnotation) SetTargetsField

func (s NodeAnnotation) SetTargetsField(v bool)

func (NodeAnnotation) SetTargetsFile

func (s NodeAnnotation) SetTargetsFile(v bool)

func (NodeAnnotation) SetTargetsGroup

func (s NodeAnnotation) SetTargetsGroup(v bool)

func (NodeAnnotation) SetTargetsInterface

func (s NodeAnnotation) SetTargetsInterface(v bool)

func (NodeAnnotation) SetTargetsMethod

func (s NodeAnnotation) SetTargetsMethod(v bool)

func (NodeAnnotation) SetTargetsParam

func (s NodeAnnotation) SetTargetsParam(v bool)

func (NodeAnnotation) SetTargetsStruct

func (s NodeAnnotation) SetTargetsStruct(v bool)

func (NodeAnnotation) SetTargetsUnion

func (s NodeAnnotation) SetTargetsUnion(v bool)

func (NodeAnnotation) SetType

func (s NodeAnnotation) SetType(v Type)

func (NodeAnnotation) TargetsAnnotation

func (s NodeAnnotation) TargetsAnnotation() bool

func (NodeAnnotation) TargetsConst

func (s NodeAnnotation) TargetsConst() bool

func (NodeAnnotation) TargetsEnum

func (s NodeAnnotation) TargetsEnum() bool

func (NodeAnnotation) TargetsEnumerant

func (s NodeAnnotation) TargetsEnumerant() bool

func (NodeAnnotation) TargetsField

func (s NodeAnnotation) TargetsField() bool

func (NodeAnnotation) TargetsFile

func (s NodeAnnotation) TargetsFile() bool

func (NodeAnnotation) TargetsGroup

func (s NodeAnnotation) TargetsGroup() bool

func (NodeAnnotation) TargetsInterface

func (s NodeAnnotation) TargetsInterface() bool

func (NodeAnnotation) TargetsMethod

func (s NodeAnnotation) TargetsMethod() bool

func (NodeAnnotation) TargetsParam

func (s NodeAnnotation) TargetsParam() bool

func (NodeAnnotation) TargetsStruct

func (s NodeAnnotation) TargetsStruct() bool

func (NodeAnnotation) TargetsUnion

func (s NodeAnnotation) TargetsUnion() bool

func (NodeAnnotation) Type

func (s NodeAnnotation) Type() Type

type NodeConst

type NodeConst Node

func (NodeConst) SetType

func (s NodeConst) SetType(v Type)

func (NodeConst) SetValue

func (s NodeConst) SetValue(v Value)

func (NodeConst) Type

func (s NodeConst) Type() Type

func (NodeConst) Value

func (s NodeConst) Value() Value

type NodeEnum

type NodeEnum Node

func (NodeEnum) Enumerants

func (s NodeEnum) Enumerants() Enumerant_List

func (NodeEnum) SetEnumerants

func (s NodeEnum) SetEnumerants(v Enumerant_List)

type NodeInterface

type NodeInterface Node

func (NodeInterface) Methods

func (s NodeInterface) Methods() Method_List

func (NodeInterface) SetMethods

func (s NodeInterface) SetMethods(v Method_List)

func (NodeInterface) SetSuperclasses

func (s NodeInterface) SetSuperclasses(v Superclass_List)

func (NodeInterface) Superclasses

func (s NodeInterface) Superclasses() Superclass_List

type NodeNestedNode

type NodeNestedNode C.Struct

func AutoNewNodeNestedNode

func AutoNewNodeNestedNode(s *C.Segment) NodeNestedNode

func NewNodeNestedNode

func NewNodeNestedNode(s *C.Segment) NodeNestedNode

func NewRootNodeNestedNode

func NewRootNodeNestedNode(s *C.Segment) NodeNestedNode

func ReadRootNodeNestedNode

func ReadRootNodeNestedNode(s *C.Segment) NodeNestedNode

func (NodeNestedNode) Id

func (s NodeNestedNode) Id() uint64

func (NodeNestedNode) MarshalJSON

func (s NodeNestedNode) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (NodeNestedNode) Name

func (s NodeNestedNode) Name() string

func (NodeNestedNode) SetId

func (s NodeNestedNode) SetId(v uint64)

func (NodeNestedNode) SetName

func (s NodeNestedNode) SetName(v string)

type NodeNestedNode_List

type NodeNestedNode_List C.PointerList

func NewNodeNestedNodeList

func NewNodeNestedNodeList(s *C.Segment, sz int) NodeNestedNode_List

func (NodeNestedNode_List) At

func (NodeNestedNode_List) Len

func (s NodeNestedNode_List) Len() int

func (NodeNestedNode_List) Set

func (s NodeNestedNode_List) Set(i int, item NodeNestedNode)

func (NodeNestedNode_List) ToArray

func (s NodeNestedNode_List) ToArray() []NodeNestedNode

type NodeParameter

type NodeParameter C.Struct

func AutoNewNodeParameter

func AutoNewNodeParameter(s *C.Segment) NodeParameter

func NewNodeParameter

func NewNodeParameter(s *C.Segment) NodeParameter

func NewRootNodeParameter

func NewRootNodeParameter(s *C.Segment) NodeParameter

func ReadRootNodeParameter

func ReadRootNodeParameter(s *C.Segment) NodeParameter

func (NodeParameter) MarshalJSON

func (s NodeParameter) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (NodeParameter) Name

func (s NodeParameter) Name() string

func (NodeParameter) SetName

func (s NodeParameter) SetName(v string)

type NodeParameter_List

type NodeParameter_List C.PointerList

func NewNodeParameterList

func NewNodeParameterList(s *C.Segment, sz int) NodeParameter_List

func (NodeParameter_List) At

func (NodeParameter_List) Len

func (s NodeParameter_List) Len() int

func (NodeParameter_List) Set

func (s NodeParameter_List) Set(i int, item NodeParameter)

func (NodeParameter_List) ToArray

func (s NodeParameter_List) ToArray() []NodeParameter

type NodeStruct

type NodeStruct Node

func (NodeStruct) DataWordCount

func (s NodeStruct) DataWordCount() uint16

func (NodeStruct) DiscriminantCount

func (s NodeStruct) DiscriminantCount() uint16

func (NodeStruct) DiscriminantOffset

func (s NodeStruct) DiscriminantOffset() uint32

func (NodeStruct) Fields

func (s NodeStruct) Fields() Field_List

func (NodeStruct) IsGroup

func (s NodeStruct) IsGroup() bool

func (NodeStruct) PointerCount

func (s NodeStruct) PointerCount() uint16

func (NodeStruct) PreferredListEncoding

func (s NodeStruct) PreferredListEncoding() ElementSize

func (NodeStruct) SetDataWordCount

func (s NodeStruct) SetDataWordCount(v uint16)

func (NodeStruct) SetDiscriminantCount

func (s NodeStruct) SetDiscriminantCount(v uint16)

func (NodeStruct) SetDiscriminantOffset

func (s NodeStruct) SetDiscriminantOffset(v uint32)

func (NodeStruct) SetFields

func (s NodeStruct) SetFields(v Field_List)

func (NodeStruct) SetIsGroup

func (s NodeStruct) SetIsGroup(v bool)

func (NodeStruct) SetPointerCount

func (s NodeStruct) SetPointerCount(v uint16)

func (NodeStruct) SetPreferredListEncoding

func (s NodeStruct) SetPreferredListEncoding(v ElementSize)

type Node_List

type Node_List C.PointerList

func NewNodeList

func NewNodeList(s *C.Segment, sz int) Node_List

func (Node_List) At

func (s Node_List) At(i int) Node

func (Node_List) Len

func (s Node_List) Len() int

func (Node_List) Set

func (s Node_List) Set(i int, item Node)

func (Node_List) ToArray

func (s Node_List) ToArray() []Node

type Node_Which

type Node_Which uint16
const (
	NODE_FILE       Node_Which = 0
	NODE_STRUCT     Node_Which = 1
	NODE_ENUM       Node_Which = 2
	NODE_INTERFACE  Node_Which = 3
	NODE_CONST      Node_Which = 4
	NODE_ANNOTATION Node_Which = 5
)

type Superclass

type Superclass C.Struct

func AutoNewSuperclass

func AutoNewSuperclass(s *C.Segment) Superclass

func NewRootSuperclass

func NewRootSuperclass(s *C.Segment) Superclass

func NewSuperclass

func NewSuperclass(s *C.Segment) Superclass

func ReadRootSuperclass

func ReadRootSuperclass(s *C.Segment) Superclass

func (Superclass) Brand

func (s Superclass) Brand() Brand

func (Superclass) Id

func (s Superclass) Id() uint64

func (Superclass) MarshalJSON

func (s Superclass) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Superclass) SetBrand

func (s Superclass) SetBrand(v Brand)

func (Superclass) SetId

func (s Superclass) SetId(v uint64)

type Superclass_List

type Superclass_List C.PointerList

func NewSuperclassList

func NewSuperclassList(s *C.Segment, sz int) Superclass_List

func (Superclass_List) At

func (s Superclass_List) At(i int) Superclass

func (Superclass_List) Len

func (s Superclass_List) Len() int

func (Superclass_List) Set

func (s Superclass_List) Set(i int, item Superclass)

func (Superclass_List) ToArray

func (s Superclass_List) ToArray() []Superclass

type Type

type Type C.Struct

func AutoNewType

func AutoNewType(s *C.Segment) Type

func NewRootType

func NewRootType(s *C.Segment) Type

func NewType

func NewType(s *C.Segment) Type

func ReadRootType

func ReadRootType(s *C.Segment) Type

func (Type) AnyPointer

func (s Type) AnyPointer() TypeAnyPointer

func (Type) Enum

func (s Type) Enum() TypeEnum

func (Type) Interface

func (s Type) Interface() TypeInterface

func (Type) List

func (s Type) List() TypeList

func (Type) MarshalJSON

func (s Type) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Type) SetAnyPointer

func (s Type) SetAnyPointer()

func (Type) SetBool

func (s Type) SetBool()

func (Type) SetData

func (s Type) SetData()

func (Type) SetEnum

func (s Type) SetEnum()

func (Type) SetFloat32

func (s Type) SetFloat32()

func (Type) SetFloat64

func (s Type) SetFloat64()

func (Type) SetInt16

func (s Type) SetInt16()

func (Type) SetInt32

func (s Type) SetInt32()

func (Type) SetInt64

func (s Type) SetInt64()

func (Type) SetInt8

func (s Type) SetInt8()

func (Type) SetInterface

func (s Type) SetInterface()

func (Type) SetList

func (s Type) SetList()

func (Type) SetStruct

func (s Type) SetStruct()

func (Type) SetText

func (s Type) SetText()

func (Type) SetUint16

func (s Type) SetUint16()

func (Type) SetUint32

func (s Type) SetUint32()

func (Type) SetUint64

func (s Type) SetUint64()

func (Type) SetUint8

func (s Type) SetUint8()

func (Type) SetVoid

func (s Type) SetVoid()

func (Type) Struct

func (s Type) Struct() TypeStruct

func (Type) Which

func (s Type) Which() Type_Which

type TypeAnyPointer

type TypeAnyPointer Type

func (TypeAnyPointer) ImplicitMethodParameter

func (s TypeAnyPointer) ImplicitMethodParameter() TypeAnyPointerImplicitMethodParameter

func (TypeAnyPointer) Parameter

func (TypeAnyPointer) SetImplicitMethodParameter

func (s TypeAnyPointer) SetImplicitMethodParameter()

func (TypeAnyPointer) SetParameter

func (s TypeAnyPointer) SetParameter()

func (TypeAnyPointer) SetUnconstrained

func (s TypeAnyPointer) SetUnconstrained()

func (TypeAnyPointer) Unconstrained

func (s TypeAnyPointer) Unconstrained() TypeAnyPointerUnconstrained

func (TypeAnyPointer) Which

type TypeAnyPointerImplicitMethodParameter

type TypeAnyPointerImplicitMethodParameter Type

func (TypeAnyPointerImplicitMethodParameter) ParameterIndex

func (s TypeAnyPointerImplicitMethodParameter) ParameterIndex() uint16

func (TypeAnyPointerImplicitMethodParameter) SetParameterIndex

func (s TypeAnyPointerImplicitMethodParameter) SetParameterIndex(v uint16)

type TypeAnyPointerParameter

type TypeAnyPointerParameter Type

func (TypeAnyPointerParameter) ParameterIndex

func (s TypeAnyPointerParameter) ParameterIndex() uint16

func (TypeAnyPointerParameter) ScopeId

func (s TypeAnyPointerParameter) ScopeId() uint64

func (TypeAnyPointerParameter) SetParameterIndex

func (s TypeAnyPointerParameter) SetParameterIndex(v uint16)

func (TypeAnyPointerParameter) SetScopeId

func (s TypeAnyPointerParameter) SetScopeId(v uint64)

type TypeAnyPointerUnconstrained

type TypeAnyPointerUnconstrained Type

func (TypeAnyPointerUnconstrained) SetAnyKind

func (s TypeAnyPointerUnconstrained) SetAnyKind()

func (TypeAnyPointerUnconstrained) SetCapability

func (s TypeAnyPointerUnconstrained) SetCapability()

func (TypeAnyPointerUnconstrained) SetList

func (s TypeAnyPointerUnconstrained) SetList()

func (TypeAnyPointerUnconstrained) SetStruct

func (s TypeAnyPointerUnconstrained) SetStruct()

func (TypeAnyPointerUnconstrained) Which

type TypeAnyPointerUnconstrained_Which

type TypeAnyPointerUnconstrained_Which uint16
const (
	TYPEANYPOINTERUNCONSTRAINED_ANYKIND    TypeAnyPointerUnconstrained_Which = 0
	TYPEANYPOINTERUNCONSTRAINED_STRUCT     TypeAnyPointerUnconstrained_Which = 1
	TYPEANYPOINTERUNCONSTRAINED_LIST       TypeAnyPointerUnconstrained_Which = 2
	TYPEANYPOINTERUNCONSTRAINED_CAPABILITY TypeAnyPointerUnconstrained_Which = 3
)

type TypeAnyPointer_Which

type TypeAnyPointer_Which uint16
const (
	TYPEANYPOINTER_UNCONSTRAINED           TypeAnyPointer_Which = 0
	TYPEANYPOINTER_PARAMETER               TypeAnyPointer_Which = 1
	TYPEANYPOINTER_IMPLICITMETHODPARAMETER TypeAnyPointer_Which = 2
)

type TypeEnum

type TypeEnum Type

func (TypeEnum) Brand

func (s TypeEnum) Brand() Brand

func (TypeEnum) SetBrand

func (s TypeEnum) SetBrand(v Brand)

func (TypeEnum) SetTypeId

func (s TypeEnum) SetTypeId(v uint64)

func (TypeEnum) TypeId

func (s TypeEnum) TypeId() uint64

type TypeInterface

type TypeInterface Type

func (TypeInterface) Brand

func (s TypeInterface) Brand() Brand

func (TypeInterface) SetBrand

func (s TypeInterface) SetBrand(v Brand)

func (TypeInterface) SetTypeId

func (s TypeInterface) SetTypeId(v uint64)

func (TypeInterface) TypeId

func (s TypeInterface) TypeId() uint64

type TypeList

type TypeList Type

func (TypeList) ElementType

func (s TypeList) ElementType() Type

func (TypeList) SetElementType

func (s TypeList) SetElementType(v Type)

type TypeStruct

type TypeStruct Type

func (TypeStruct) Brand

func (s TypeStruct) Brand() Brand

func (TypeStruct) SetBrand

func (s TypeStruct) SetBrand(v Brand)

func (TypeStruct) SetTypeId

func (s TypeStruct) SetTypeId(v uint64)

func (TypeStruct) TypeId

func (s TypeStruct) TypeId() uint64

type Type_List

type Type_List C.PointerList

func NewTypeList

func NewTypeList(s *C.Segment, sz int) Type_List

func (Type_List) At

func (s Type_List) At(i int) Type

func (Type_List) Len

func (s Type_List) Len() int

func (Type_List) Set

func (s Type_List) Set(i int, item Type)

func (Type_List) ToArray

func (s Type_List) ToArray() []Type

type Type_Which

type Type_Which uint16
const (
	TYPE_VOID       Type_Which = 0
	TYPE_BOOL       Type_Which = 1
	TYPE_INT8       Type_Which = 2
	TYPE_INT16      Type_Which = 3
	TYPE_INT32      Type_Which = 4
	TYPE_INT64      Type_Which = 5
	TYPE_UINT8      Type_Which = 6
	TYPE_UINT16     Type_Which = 7
	TYPE_UINT32     Type_Which = 8
	TYPE_UINT64     Type_Which = 9
	TYPE_FLOAT32    Type_Which = 10
	TYPE_FLOAT64    Type_Which = 11
	TYPE_TEXT       Type_Which = 12
	TYPE_DATA       Type_Which = 13
	TYPE_LIST       Type_Which = 14
	TYPE_ENUM       Type_Which = 15
	TYPE_STRUCT     Type_Which = 16
	TYPE_INTERFACE  Type_Which = 17
	TYPE_ANYPOINTER Type_Which = 18
)

type Value

type Value C.Struct

func AutoNewValue

func AutoNewValue(s *C.Segment) Value

func NewRootValue

func NewRootValue(s *C.Segment) Value

func NewValue

func NewValue(s *C.Segment) Value

func ReadRootValue

func ReadRootValue(s *C.Segment) Value

func (Value) AnyPointer

func (s Value) AnyPointer() C.Object

func (Value) Bool

func (s Value) Bool() bool

func (Value) Data

func (s Value) Data() []byte

func (Value) Enum

func (s Value) Enum() uint16

func (Value) Float32

func (s Value) Float32() float32

func (Value) Float64

func (s Value) Float64() float64

func (Value) Int16

func (s Value) Int16() int16

func (Value) Int32

func (s Value) Int32() int32

func (Value) Int64

func (s Value) Int64() int64

func (Value) Int8

func (s Value) Int8() int8

func (Value) List

func (s Value) List() C.Object

func (Value) MarshalJSON

func (s Value) MarshalJSON() (bs []byte, err error)

capn.JSON_enabled == false so we stub MarshallJSON().

func (Value) SetAnyPointer

func (s Value) SetAnyPointer(v C.Object)

func (Value) SetBool

func (s Value) SetBool(v bool)

func (Value) SetData

func (s Value) SetData(v []byte)

func (Value) SetEnum

func (s Value) SetEnum(v uint16)

func (Value) SetFloat32

func (s Value) SetFloat32(v float32)

func (Value) SetFloat64

func (s Value) SetFloat64(v float64)

func (Value) SetInt16

func (s Value) SetInt16(v int16)

func (Value) SetInt32

func (s Value) SetInt32(v int32)

func (Value) SetInt64

func (s Value) SetInt64(v int64)

func (Value) SetInt8

func (s Value) SetInt8(v int8)

func (Value) SetInterface

func (s Value) SetInterface()

func (Value) SetList

func (s Value) SetList(v C.Object)

func (Value) SetStruct

func (s Value) SetStruct(v C.Object)

func (Value) SetText

func (s Value) SetText(v string)

func (Value) SetUint16

func (s Value) SetUint16(v uint16)

func (Value) SetUint32

func (s Value) SetUint32(v uint32)

func (Value) SetUint64

func (s Value) SetUint64(v uint64)

func (Value) SetUint8

func (s Value) SetUint8(v uint8)

func (Value) SetVoid

func (s Value) SetVoid()

func (Value) Struct

func (s Value) Struct() C.Object

func (Value) Text

func (s Value) Text() string

func (Value) Uint16

func (s Value) Uint16() uint16

func (Value) Uint32

func (s Value) Uint32() uint32

func (Value) Uint64

func (s Value) Uint64() uint64

func (Value) Uint8

func (s Value) Uint8() uint8

func (Value) Which

func (s Value) Which() Value_Which

type Value_List

type Value_List C.PointerList

func NewValueList

func NewValueList(s *C.Segment, sz int) Value_List

func (Value_List) At

func (s Value_List) At(i int) Value

func (Value_List) Len

func (s Value_List) Len() int

func (Value_List) Set

func (s Value_List) Set(i int, item Value)

func (Value_List) ToArray

func (s Value_List) ToArray() []Value

type Value_Which

type Value_Which uint16
const (
	VALUE_VOID       Value_Which = 0
	VALUE_BOOL       Value_Which = 1
	VALUE_INT8       Value_Which = 2
	VALUE_INT16      Value_Which = 3
	VALUE_INT32      Value_Which = 4
	VALUE_INT64      Value_Which = 5
	VALUE_UINT8      Value_Which = 6
	VALUE_UINT16     Value_Which = 7
	VALUE_UINT32     Value_Which = 8
	VALUE_UINT64     Value_Which = 9
	VALUE_FLOAT32    Value_Which = 10
	VALUE_FLOAT64    Value_Which = 11
	VALUE_TEXT       Value_Which = 12
	VALUE_DATA       Value_Which = 13
	VALUE_LIST       Value_Which = 14
	VALUE_ENUM       Value_Which = 15
	VALUE_STRUCT     Value_Which = 16
	VALUE_INTERFACE  Value_Which = 17
	VALUE_ANYPOINTER Value_Which = 18
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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