host

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 Context

type Context struct {
	Data string
}

func DecodeContext

func DecodeContext(x *Context, b []byte) (*Context, error)

func NewContext

func NewContext() *Context

func (*Context) Encode

func (x *Context) Encode(b *polyglot.Buffer)

type Signature

type Signature struct {
	Context *Context
	// contains filtered or unexported fields
}

sig is the host representation of the signature

Users should not use this type directly, but instead pass the Signature() 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 as an argument

func (*Signature) Error

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

Error writes the signature into a byte slice and returns it

func (*Signature) Hash

func (x *Signature) Hash() string

Hash returns the hash of the signature

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

Jump to

Keyboard shortcuts

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