Documentation ¶
Index ¶
- Variables
- type EmptyModel
- type EmptyModelWithDescription
- type GenericEnum
- type ModelWithAllFieldTypes
- type ModelWithEmbeddedModels
- type ModelWithEmbeddedModelsAccessor
- type ModelWithEmbeddedModelsAccessorAndDescription
- type ModelWithEmbeddedModelsAndDescription
- type ModelWithEnum
- type ModelWithEnumAccessor
- type ModelWithEnumAccessorAndDescription
- type ModelWithEnumAndDescription
- type ModelWithMultipleFields
- type ModelWithMultipleFieldsAccessor
- type ModelWithMultipleFieldsAccessorAndDescription
- type ModelWithMultipleFieldsAndDescription
- type ModelWithSingleInt32Field
- type ModelWithSingleInt32FieldAndDescription
- type ModelWithSingleStringField
- type ModelWithSingleStringFieldAndDescription
- type Signature
Constants ¶
This section is empty.
Variables ¶
var ( NilDecode = errors.New("cannot decode into a nil root struct") InvalidEnum = errors.New("invalid enum value") )
Functions ¶
This section is empty.
Types ¶
type EmptyModel ¶
type EmptyModel struct { }
func DecodeEmptyModel ¶
func DecodeEmptyModel(x *EmptyModel, b []byte) (*EmptyModel, error)
func NewEmptyModel ¶
func NewEmptyModel() *EmptyModel
func (*EmptyModel) Encode ¶
func (x *EmptyModel) Encode(b *polyglot.Buffer)
type EmptyModelWithDescription ¶
type EmptyModelWithDescription struct { }
EmptyModelWithDescription: Test Description
func DecodeEmptyModelWithDescription ¶
func DecodeEmptyModelWithDescription(x *EmptyModelWithDescription, b []byte) (*EmptyModelWithDescription, error)
func NewEmptyModelWithDescription ¶
func NewEmptyModelWithDescription() *EmptyModelWithDescription
func (*EmptyModelWithDescription) Encode ¶
func (x *EmptyModelWithDescription) Encode(b *polyglot.Buffer)
type GenericEnum ¶
type GenericEnum uint32
const ( GenericEnumFirstValue GenericEnum = 0 GenericEnumSecondValue GenericEnum = 1 GenericEnumDefaultValue GenericEnum = 2 )
type ModelWithAllFieldTypes ¶
type ModelWithAllFieldTypes struct { ModelField *EmptyModel ModelArrayField []EmptyModel StringField string StringArrayField []string StringMapField map[string]string StringMapFieldEmbedded map[string]EmptyModel Int32Field int32 Int32ArrayField []int32 Int32MapField map[int32]int32 Int32MapFieldEmbedded map[int32]EmptyModel Int64Field int64 Int64ArrayField []int64 Int64MapField map[int64]int64 Int64MapFieldEmbedded map[int64]EmptyModel Uint32Field uint32 Uint32ArrayField []uint32 Uint32MapField map[uint32]uint32 Uint32MapFieldEmbedded map[uint32]EmptyModel Uint64Field uint64 Uint64ArrayField []uint64 Uint64MapField map[uint64]uint64 Uint64MapFieldEmbedded map[uint64]EmptyModel Float32Field float32 Float32ArrayField []float32 Float64Field float64 Float64ArrayField []float64 EnumField GenericEnum EnumArrayField []GenericEnum EnumMapField map[GenericEnum]string EnumMapFieldEmbedded map[GenericEnum]EmptyModel BytesField []byte BytesArrayField [][]byte BoolField bool BoolArrayField []bool }
func DecodeModelWithAllFieldTypes ¶
func DecodeModelWithAllFieldTypes(x *ModelWithAllFieldTypes, b []byte) (*ModelWithAllFieldTypes, error)
func NewModelWithAllFieldTypes ¶
func NewModelWithAllFieldTypes() *ModelWithAllFieldTypes
func (*ModelWithAllFieldTypes) Encode ¶
func (x *ModelWithAllFieldTypes) Encode(b *polyglot.Buffer)
type ModelWithEmbeddedModels ¶
type ModelWithEmbeddedModels struct { EmbeddedEmptyModel *EmptyModel EmbeddedModelArrayWithMultipleFieldsAccessor []ModelWithMultipleFieldsAccessor }
func DecodeModelWithEmbeddedModels ¶
func DecodeModelWithEmbeddedModels(x *ModelWithEmbeddedModels, b []byte) (*ModelWithEmbeddedModels, error)
func NewModelWithEmbeddedModels ¶
func NewModelWithEmbeddedModels() *ModelWithEmbeddedModels
func (*ModelWithEmbeddedModels) Encode ¶
func (x *ModelWithEmbeddedModels) Encode(b *polyglot.Buffer)
type ModelWithEmbeddedModelsAccessor ¶
type ModelWithEmbeddedModelsAccessor struct { EmbeddedEmptyModel *EmptyModel EmbeddedModelArrayWithMultipleFieldsAccessor []ModelWithMultipleFieldsAccessor }
func DecodeModelWithEmbeddedModelsAccessor ¶
func DecodeModelWithEmbeddedModelsAccessor(x *ModelWithEmbeddedModelsAccessor, b []byte) (*ModelWithEmbeddedModelsAccessor, error)
func NewModelWithEmbeddedModelsAccessor ¶
func NewModelWithEmbeddedModelsAccessor() *ModelWithEmbeddedModelsAccessor
func (*ModelWithEmbeddedModelsAccessor) Encode ¶
func (x *ModelWithEmbeddedModelsAccessor) Encode(b *polyglot.Buffer)
type ModelWithEmbeddedModelsAccessorAndDescription ¶
type ModelWithEmbeddedModelsAccessorAndDescription struct { EmbeddedEmptyModel *EmptyModel EmbeddedModelArrayWithMultipleFieldsAccessor []ModelWithMultipleFieldsAccessor }
ModelWithEmbeddedModelsAccessorAndDescription: Test Description
func DecodeModelWithEmbeddedModelsAccessorAndDescription ¶
func DecodeModelWithEmbeddedModelsAccessorAndDescription(x *ModelWithEmbeddedModelsAccessorAndDescription, b []byte) (*ModelWithEmbeddedModelsAccessorAndDescription, error)
func NewModelWithEmbeddedModelsAccessorAndDescription ¶
func NewModelWithEmbeddedModelsAccessorAndDescription() *ModelWithEmbeddedModelsAccessorAndDescription
func (*ModelWithEmbeddedModelsAccessorAndDescription) Encode ¶
func (x *ModelWithEmbeddedModelsAccessorAndDescription) Encode(b *polyglot.Buffer)
type ModelWithEmbeddedModelsAndDescription ¶
type ModelWithEmbeddedModelsAndDescription struct { EmbeddedEmptyModel *EmptyModel EmbeddedModelArrayWithMultipleFieldsAccessor []ModelWithMultipleFieldsAccessor }
ModelWithEmbeddedModelsAndDescription: Test Description
func DecodeModelWithEmbeddedModelsAndDescription ¶
func DecodeModelWithEmbeddedModelsAndDescription(x *ModelWithEmbeddedModelsAndDescription, b []byte) (*ModelWithEmbeddedModelsAndDescription, error)
func NewModelWithEmbeddedModelsAndDescription ¶
func NewModelWithEmbeddedModelsAndDescription() *ModelWithEmbeddedModelsAndDescription
func (*ModelWithEmbeddedModelsAndDescription) Encode ¶
func (x *ModelWithEmbeddedModelsAndDescription) Encode(b *polyglot.Buffer)
type ModelWithEnum ¶
type ModelWithEnum struct {
EnumField GenericEnum
}
func DecodeModelWithEnum ¶
func DecodeModelWithEnum(x *ModelWithEnum, b []byte) (*ModelWithEnum, error)
func NewModelWithEnum ¶
func NewModelWithEnum() *ModelWithEnum
func (*ModelWithEnum) Encode ¶
func (x *ModelWithEnum) Encode(b *polyglot.Buffer)
type ModelWithEnumAccessor ¶
type ModelWithEnumAccessor struct {
EnumField GenericEnum
}
func DecodeModelWithEnumAccessor ¶
func DecodeModelWithEnumAccessor(x *ModelWithEnumAccessor, b []byte) (*ModelWithEnumAccessor, error)
func NewModelWithEnumAccessor ¶
func NewModelWithEnumAccessor() *ModelWithEnumAccessor
func (*ModelWithEnumAccessor) Encode ¶
func (x *ModelWithEnumAccessor) Encode(b *polyglot.Buffer)
type ModelWithEnumAccessorAndDescription ¶
type ModelWithEnumAccessorAndDescription struct {
EnumField GenericEnum
}
ModelWithEnumAccessorAndDescription: Test Description
func DecodeModelWithEnumAccessorAndDescription ¶
func DecodeModelWithEnumAccessorAndDescription(x *ModelWithEnumAccessorAndDescription, b []byte) (*ModelWithEnumAccessorAndDescription, error)
func NewModelWithEnumAccessorAndDescription ¶
func NewModelWithEnumAccessorAndDescription() *ModelWithEnumAccessorAndDescription
func (*ModelWithEnumAccessorAndDescription) Encode ¶
func (x *ModelWithEnumAccessorAndDescription) Encode(b *polyglot.Buffer)
type ModelWithEnumAndDescription ¶
type ModelWithEnumAndDescription struct {
EnumField GenericEnum
}
ModelWithEnumAndDescription: Test Description
func DecodeModelWithEnumAndDescription ¶
func DecodeModelWithEnumAndDescription(x *ModelWithEnumAndDescription, b []byte) (*ModelWithEnumAndDescription, error)
func NewModelWithEnumAndDescription ¶
func NewModelWithEnumAndDescription() *ModelWithEnumAndDescription
func (*ModelWithEnumAndDescription) Encode ¶
func (x *ModelWithEnumAndDescription) Encode(b *polyglot.Buffer)
type ModelWithMultipleFields ¶
func DecodeModelWithMultipleFields ¶
func DecodeModelWithMultipleFields(x *ModelWithMultipleFields, b []byte) (*ModelWithMultipleFields, error)
func NewModelWithMultipleFields ¶
func NewModelWithMultipleFields() *ModelWithMultipleFields
func (*ModelWithMultipleFields) Encode ¶
func (x *ModelWithMultipleFields) Encode(b *polyglot.Buffer)
type ModelWithMultipleFieldsAccessor ¶
func DecodeModelWithMultipleFieldsAccessor ¶
func DecodeModelWithMultipleFieldsAccessor(x *ModelWithMultipleFieldsAccessor, b []byte) (*ModelWithMultipleFieldsAccessor, error)
func NewModelWithMultipleFieldsAccessor ¶
func NewModelWithMultipleFieldsAccessor() *ModelWithMultipleFieldsAccessor
func (*ModelWithMultipleFieldsAccessor) Encode ¶
func (x *ModelWithMultipleFieldsAccessor) Encode(b *polyglot.Buffer)
type ModelWithMultipleFieldsAccessorAndDescription ¶
ModelWithMultipleFieldsAccessorAndDescription: Test Description
func DecodeModelWithMultipleFieldsAccessorAndDescription ¶
func DecodeModelWithMultipleFieldsAccessorAndDescription(x *ModelWithMultipleFieldsAccessorAndDescription, b []byte) (*ModelWithMultipleFieldsAccessorAndDescription, error)
func NewModelWithMultipleFieldsAccessorAndDescription ¶
func NewModelWithMultipleFieldsAccessorAndDescription() *ModelWithMultipleFieldsAccessorAndDescription
func (*ModelWithMultipleFieldsAccessorAndDescription) Encode ¶
func (x *ModelWithMultipleFieldsAccessorAndDescription) Encode(b *polyglot.Buffer)
type ModelWithMultipleFieldsAndDescription ¶
ModelWithMultipleFieldsAndDescription: Test Description
func DecodeModelWithMultipleFieldsAndDescription ¶
func DecodeModelWithMultipleFieldsAndDescription(x *ModelWithMultipleFieldsAndDescription, b []byte) (*ModelWithMultipleFieldsAndDescription, error)
func NewModelWithMultipleFieldsAndDescription ¶
func NewModelWithMultipleFieldsAndDescription() *ModelWithMultipleFieldsAndDescription
func (*ModelWithMultipleFieldsAndDescription) Encode ¶
func (x *ModelWithMultipleFieldsAndDescription) Encode(b *polyglot.Buffer)
type ModelWithSingleInt32Field ¶
type ModelWithSingleInt32Field struct {
Int32Field int32
}
func DecodeModelWithSingleInt32Field ¶
func DecodeModelWithSingleInt32Field(x *ModelWithSingleInt32Field, b []byte) (*ModelWithSingleInt32Field, error)
func NewModelWithSingleInt32Field ¶
func NewModelWithSingleInt32Field() *ModelWithSingleInt32Field
func (*ModelWithSingleInt32Field) Encode ¶
func (x *ModelWithSingleInt32Field) Encode(b *polyglot.Buffer)
type ModelWithSingleInt32FieldAndDescription ¶
type ModelWithSingleInt32FieldAndDescription struct {
Int32Field int32
}
ModelWithSingleInt32FieldAndDescription: Test Description
func DecodeModelWithSingleInt32FieldAndDescription ¶
func DecodeModelWithSingleInt32FieldAndDescription(x *ModelWithSingleInt32FieldAndDescription, b []byte) (*ModelWithSingleInt32FieldAndDescription, error)
func NewModelWithSingleInt32FieldAndDescription ¶
func NewModelWithSingleInt32FieldAndDescription() *ModelWithSingleInt32FieldAndDescription
func (*ModelWithSingleInt32FieldAndDescription) Encode ¶
func (x *ModelWithSingleInt32FieldAndDescription) Encode(b *polyglot.Buffer)
type ModelWithSingleStringField ¶
type ModelWithSingleStringField struct {
StringField string
}
func DecodeModelWithSingleStringField ¶
func DecodeModelWithSingleStringField(x *ModelWithSingleStringField, b []byte) (*ModelWithSingleStringField, error)
func NewModelWithSingleStringField ¶
func NewModelWithSingleStringField() *ModelWithSingleStringField
func (*ModelWithSingleStringField) Encode ¶
func (x *ModelWithSingleStringField) Encode(b *polyglot.Buffer)
type ModelWithSingleStringFieldAndDescription ¶
type ModelWithSingleStringFieldAndDescription struct {
StringField string
}
ModelWithSingleStringFieldAndDescription: Test Description
func DecodeModelWithSingleStringFieldAndDescription ¶
func DecodeModelWithSingleStringFieldAndDescription(x *ModelWithSingleStringFieldAndDescription, b []byte) (*ModelWithSingleStringFieldAndDescription, error)
func NewModelWithSingleStringFieldAndDescription ¶
func NewModelWithSingleStringFieldAndDescription() *ModelWithSingleStringFieldAndDescription
func (*ModelWithSingleStringFieldAndDescription) Encode ¶
func (x *ModelWithSingleStringFieldAndDescription) Encode(b *polyglot.Buffer)
type Signature ¶
type Signature struct { Context *ModelWithAllFieldTypes // contains filtered or unexported fields }
Signature is the host representation of the signature
Users should not use this type directly, but instead pass the New() function to the Scale Runtime
func New ¶
func New() *Signature
New returns a new signature and tells the Scale Runtime how to use it
This function should be passed into the scale runtime config as an argument
func (*Signature) Error ¶
Error writes the signature into a byte slice and returns it
This method is meant to be used by the Scale Runtime to return an error
func (*Signature) Hash ¶
Hash returns the hash of the signature
This method is meant to be used by the Scale Runtime to validate Signature and Function compatibility