signature

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

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 NewModelWithEmbeddedModelsAccessor

func NewModelWithEmbeddedModelsAccessor() *ModelWithEmbeddedModelsAccessor

func (*ModelWithEmbeddedModelsAccessor) Encode

type ModelWithEmbeddedModelsAccessorAndDescription

type ModelWithEmbeddedModelsAccessorAndDescription struct {
	EmbeddedEmptyModel *EmptyModel

	EmbeddedModelArrayWithMultipleFieldsAccessor []ModelWithMultipleFieldsAccessor
}

ModelWithEmbeddedModelsAccessorAndDescription: Test Description

func NewModelWithEmbeddedModelsAccessorAndDescription

func NewModelWithEmbeddedModelsAccessorAndDescription() *ModelWithEmbeddedModelsAccessorAndDescription

func (*ModelWithEmbeddedModelsAccessorAndDescription) Encode

type ModelWithEmbeddedModelsAndDescription

type ModelWithEmbeddedModelsAndDescription struct {
	EmbeddedEmptyModel *EmptyModel

	EmbeddedModelArrayWithMultipleFieldsAccessor []ModelWithMultipleFieldsAccessor
}

ModelWithEmbeddedModelsAndDescription: Test Description

func NewModelWithEmbeddedModelsAndDescription

func NewModelWithEmbeddedModelsAndDescription() *ModelWithEmbeddedModelsAndDescription

func (*ModelWithEmbeddedModelsAndDescription) Encode

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 NewModelWithEnumAccessorAndDescription

func NewModelWithEnumAccessorAndDescription() *ModelWithEnumAccessorAndDescription

func (*ModelWithEnumAccessorAndDescription) Encode

type ModelWithEnumAndDescription

type ModelWithEnumAndDescription struct {
	EnumField GenericEnum
}

ModelWithEnumAndDescription: Test Description

func NewModelWithEnumAndDescription

func NewModelWithEnumAndDescription() *ModelWithEnumAndDescription

func (*ModelWithEnumAndDescription) Encode

type ModelWithMultipleFields

type ModelWithMultipleFields struct {
	StringField string

	Int32Field int32
}

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

type ModelWithMultipleFieldsAccessor struct {
	StringField string

	Int32Field int32
}

func NewModelWithMultipleFieldsAccessor

func NewModelWithMultipleFieldsAccessor() *ModelWithMultipleFieldsAccessor

func (*ModelWithMultipleFieldsAccessor) Encode

type ModelWithMultipleFieldsAccessorAndDescription

type ModelWithMultipleFieldsAccessorAndDescription struct {
	StringField string

	Int32Field int32
}

ModelWithMultipleFieldsAccessorAndDescription: Test Description

func NewModelWithMultipleFieldsAccessorAndDescription

func NewModelWithMultipleFieldsAccessorAndDescription() *ModelWithMultipleFieldsAccessorAndDescription

func (*ModelWithMultipleFieldsAccessorAndDescription) Encode

type ModelWithMultipleFieldsAndDescription

type ModelWithMultipleFieldsAndDescription struct {
	StringField string

	Int32Field int32
}

ModelWithMultipleFieldsAndDescription: Test Description

func NewModelWithMultipleFieldsAndDescription

func NewModelWithMultipleFieldsAndDescription() *ModelWithMultipleFieldsAndDescription

func (*ModelWithMultipleFieldsAndDescription) Encode

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

type ModelWithSingleInt32FieldAndDescription

type ModelWithSingleInt32FieldAndDescription struct {
	Int32Field int32
}

ModelWithSingleInt32FieldAndDescription: Test Description

func NewModelWithSingleInt32FieldAndDescription

func NewModelWithSingleInt32FieldAndDescription() *ModelWithSingleInt32FieldAndDescription

func (*ModelWithSingleInt32FieldAndDescription) Encode

type ModelWithSingleStringField

type ModelWithSingleStringField struct {
	StringField string
}

func NewModelWithSingleStringField

func NewModelWithSingleStringField() *ModelWithSingleStringField

func (*ModelWithSingleStringField) Encode

type ModelWithSingleStringFieldAndDescription

type ModelWithSingleStringFieldAndDescription struct {
	StringField string
}

ModelWithSingleStringFieldAndDescription: Test Description

func NewModelWithSingleStringFieldAndDescription

func NewModelWithSingleStringFieldAndDescription() *ModelWithSingleStringFieldAndDescription

func (*ModelWithSingleStringFieldAndDescription) Encode

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

func (x *Signature) Error(err error) []byte

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

func (x *Signature) Hash() string

Hash returns the hash of the signature

This method is meant to be used by the Scale Runtime to validate Signature and Function compatibility

func (*Signature) Read

func (x *Signature) Read(b []byte) error

Read reads the context from the given byte slice and returns an error if one occurred

This method is meant to be used by the Scale Runtime to deserialize the Signature

func (*Signature) Write

func (x *Signature) Write() []byte

Write writes the signature into a byte slice and returns it

This method is meant to be used by the Scale Runtime to serialize the Signature

Jump to

Keyboard shortcuts

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