types

package
v0.0.0-...-efcff09 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OrderedIntMapTag = byte(0)
	OrderedStrMapTag = byte(1)
	OrderedBufMapTag = byte(2)
)

Variables

This section is empty.

Functions

func DeserializeMap

func DeserializeMap(f goja.FunctionCall, vm *goja.Runtime) goja.Value

Note: Each call deserializes only one map and returns the rest of the array buffer arguments: bz goja.ArrayBuffer, tag uint8

func NewOrderedMapReader

func NewOrderedMapReader(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func SerializeMaps

func SerializeMaps(f goja.FunctionCall, vm *goja.Runtime) goja.Value

arguments: maps ...interface{}

Types

type BufBuilder

type BufBuilder struct {
	// contains filtered or unexported fields
}

func NewBufBuilder

func NewBufBuilder() BufBuilder

func (BufBuilder) Len

func (b BufBuilder) Len() int

func (BufBuilder) Reset

func (b BufBuilder) Reset()

func (BufBuilder) ToBuf

func (b BufBuilder) ToBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (BufBuilder) Write

func (b BufBuilder) Write(f goja.FunctionCall, vm *goja.Runtime) goja.Value

type LambdaJob

type LambdaJob struct {
	Script string   `msg:"script"` // lambdaJs
	Certs  []string `msg:"certs"`  // certs script will access
	Config string   `msg:"config"` // script config
	Inputs [][]byte `msg:"inputs"`
	State  []byte   `msg:"state"` // to be resolved to orderedMap in sandbox
}

func (*LambdaJob) DecodeMsg

func (z *LambdaJob) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*LambdaJob) EncodeMsg

func (z *LambdaJob) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*LambdaJob) MarshalMsg

func (z *LambdaJob) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*LambdaJob) Msgsize

func (z *LambdaJob) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*LambdaJob) UnmarshalMsg

func (z *LambdaJob) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type LambdaResult

type LambdaResult struct {
	Outputs [][]byte `msg:"outputs"`
	State   []byte   `msg:"state"` // usually, this is the serialized result of ordered map
	Error   string   `msg:"error"`
}

todo: add error and status field

func (*LambdaResult) DecodeMsg

func (z *LambdaResult) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*LambdaResult) EncodeMsg

func (z *LambdaResult) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*LambdaResult) MarshalMsg

func (z *LambdaResult) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*LambdaResult) Msgsize

func (z *LambdaResult) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*LambdaResult) UnmarshalMsg

func (z *LambdaResult) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type OrderedBufMap

type OrderedBufMap struct {
	// contains filtered or unexported fields
}

func NewOrderedBufMap

func NewOrderedBufMap() OrderedBufMap

func (*OrderedBufMap) Clear

func (m *OrderedBufMap) Clear()

func (*OrderedBufMap) Delete

func (m *OrderedBufMap) Delete(k string)

func (*OrderedBufMap) Get

func (*OrderedBufMap) Len

func (m *OrderedBufMap) Len() int

func (*OrderedBufMap) Seek

func (*OrderedBufMap) SeekFirst

func (m *OrderedBufMap) SeekFirst() (OrderedBufMapIter, error)

func (*OrderedBufMap) SeekLast

func (m *OrderedBufMap) SeekLast() (OrderedBufMapIter, error)

func (*OrderedBufMap) Set

func (m *OrderedBufMap) Set(k string, buf goja.ArrayBuffer)

type OrderedBufMapIter

type OrderedBufMapIter struct {
	// contains filtered or unexported fields
}

func (OrderedBufMapIter) Close

func (iter OrderedBufMapIter) Close()

func (OrderedBufMapIter) Next

func (OrderedBufMapIter) Prev

type OrderedIntMap

type OrderedIntMap struct {
	// contains filtered or unexported fields
}

func NewOrderedIntMap

func NewOrderedIntMap() OrderedIntMap

func (*OrderedIntMap) Clear

func (m *OrderedIntMap) Clear()

func (*OrderedIntMap) Delete

func (m *OrderedIntMap) Delete(k string)

func (*OrderedIntMap) Get

func (m *OrderedIntMap) Get(k string) (int64, bool)

func (*OrderedIntMap) Len

func (m *OrderedIntMap) Len() int

func (*OrderedIntMap) Seek

func (*OrderedIntMap) SeekFirst

func (m *OrderedIntMap) SeekFirst() (OrderedIntMapIter, error)

func (*OrderedIntMap) SeekLast

func (m *OrderedIntMap) SeekLast() (OrderedIntMapIter, error)

func (*OrderedIntMap) Set

func (m *OrderedIntMap) Set(k string, v int64)

type OrderedIntMapIter

type OrderedIntMapIter struct {
	// contains filtered or unexported fields
}

func (OrderedIntMapIter) Close

func (iter OrderedIntMapIter) Close()

func (OrderedIntMapIter) Next

func (iter OrderedIntMapIter) Next() (string, int64)

func (OrderedIntMapIter) Prev

func (iter OrderedIntMapIter) Prev() (string, int64)

type OrderedMapReader

type OrderedMapReader struct {
	// contains filtered or unexported fields
}

func (*OrderedMapReader) Read

Note: Each call read only one map, and keep the remaining bytes in OrderedMapReader arguments: tag uint8

func (*OrderedMapReader) Reset

func (r *OrderedMapReader) Reset()

type OrderedStrMap

type OrderedStrMap struct {
	// contains filtered or unexported fields
}

func NewOrderedStrMap

func NewOrderedStrMap() OrderedStrMap

func (*OrderedStrMap) Clear

func (m *OrderedStrMap) Clear()

func (*OrderedStrMap) Delete

func (m *OrderedStrMap) Delete(k string)

func (*OrderedStrMap) Get

func (m *OrderedStrMap) Get(k string) (string, bool)

func (*OrderedStrMap) Len

func (m *OrderedStrMap) Len() int

func (*OrderedStrMap) Seek

func (*OrderedStrMap) SeekFirst

func (m *OrderedStrMap) SeekFirst() (OrderedStrMapIter, error)

func (*OrderedStrMap) SeekLast

func (m *OrderedStrMap) SeekLast() (OrderedStrMapIter, error)

func (*OrderedStrMap) Set

func (m *OrderedStrMap) Set(k string, v string)

type OrderedStrMapIter

type OrderedStrMapIter struct {
	// contains filtered or unexported fields
}

func (OrderedStrMapIter) Close

func (iter OrderedStrMapIter) Close()

func (OrderedStrMapIter) Next

func (iter OrderedStrMapIter) Next() (string, string)

func (OrderedStrMapIter) Prev

func (iter OrderedStrMapIter) Prev() (string, string)

type Sint256

type Sint256 struct {
	// contains filtered or unexported fields
}

func BufToS256

func BufToS256(buf goja.ArrayBuffer) Sint256

func HexToS256

func HexToS256(hex string) Sint256

func S256

func S256(v int64) Sint256

func (Sint256) Abs

func (s Sint256) Abs() Sint256

func (Sint256) Add

func (s Sint256) Add(v Sint256) Sint256

func (Sint256) Div

func (s Sint256) Div(v Sint256) Sint256

func (Sint256) Equal

func (s Sint256) Equal(v Sint256) bool

func (Sint256) Gt

func (s Sint256) Gt(v Sint256) bool

func (Sint256) GtNum

func (s Sint256) GtNum(v int64) bool

func (Sint256) Gte

func (s Sint256) Gte(v Sint256) bool

func (Sint256) GteNum

func (s Sint256) GteNum(v int64) bool

func (Sint256) IsSafeInteger

func (s Sint256) IsSafeInteger() bool

func (Sint256) IsZero

func (s Sint256) IsZero() bool

func (Sint256) Lsh

func (s Sint256) Lsh(v uint) Sint256

func (Sint256) Lt

func (s Sint256) Lt(v Sint256) bool

func (Sint256) LtNum

func (s Sint256) LtNum(v int64) bool

func (Sint256) Lte

func (s Sint256) Lte(v Sint256) bool

func (Sint256) LteNum

func (s Sint256) LteNum(v int64) bool

func (Sint256) Mul

func (s Sint256) Mul(v Sint256) Sint256

func (Sint256) Neg

func (s Sint256) Neg() Sint256

func (Sint256) Rsh

func (s Sint256) Rsh(v uint) Sint256

func (Sint256) Sign

func (s Sint256) Sign() int

func (Sint256) String

func (s Sint256) String() string

Stringer interface

func (Sint256) Sub

func (s Sint256) Sub(v Sint256) Sint256

func (Sint256) ToBuf

func (s Sint256) ToBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Sint256) ToHex

func (s Sint256) ToHex(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Sint256) ToSafeInteger

func (s Sint256) ToSafeInteger() int64

func (Sint256) ToU256

func (s Sint256) ToU256() Uint256

type Uint256

type Uint256 struct {
	X *uint256.Int
}

func BufToU256

func BufToU256(buf goja.ArrayBuffer) Uint256

func HexToU256

func HexToU256(hex string) Uint256

func U256

func U256(v uint64) Uint256

func (Uint256) Add

func (u Uint256) Add(v Uint256) Uint256

func (Uint256) And

func (u Uint256) And(v Uint256) Uint256

func (Uint256) Div

func (u Uint256) Div(v Uint256) Uint256

func (Uint256) DivMod

func (u Uint256) DivMod(v Uint256) [2]Uint256

func (Uint256) Equal

func (u Uint256) Equal(v Uint256) bool

func (Uint256) Exp

func (u Uint256) Exp(v Uint256) Uint256

func (Uint256) Gt

func (u Uint256) Gt(v Uint256) bool

func (Uint256) GtNum

func (u Uint256) GtNum(v uint64) bool

func (Uint256) Gte

func (u Uint256) Gte(v Uint256) bool

func (Uint256) GteNum

func (u Uint256) GteNum(v uint64) bool

func (Uint256) Incr

func (u Uint256) Incr() Uint256

func (Uint256) IsSafeInteger

func (u Uint256) IsSafeInteger() bool

func (Uint256) IsZero

func (u Uint256) IsZero() bool

func (Uint256) Lsh

func (u Uint256) Lsh(v uint) Uint256

func (Uint256) Lt

func (u Uint256) Lt(v Uint256) bool

func (Uint256) LtNum

func (u Uint256) LtNum(v uint64) bool

func (Uint256) Lte

func (u Uint256) Lte(v Uint256) bool

func (Uint256) LteNum

func (u Uint256) LteNum(v uint64) bool

func (Uint256) Mod

func (u Uint256) Mod(v Uint256) Uint256

func (Uint256) Mul

func (u Uint256) Mul(v Uint256) Uint256

func (Uint256) Not

func (u Uint256) Not() Uint256

func (Uint256) Or

func (u Uint256) Or(v Uint256) Uint256

func (Uint256) Rsh

func (u Uint256) Rsh(v uint) Uint256

func (Uint256) Sqrt

func (u Uint256) Sqrt() Uint256

func (Uint256) String

func (u Uint256) String() string

Stringer interface

func (Uint256) Sub

func (u Uint256) Sub(v Uint256) Uint256

func (Uint256) ToBuf

func (u Uint256) ToBuf(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Uint256) ToHex

func (u Uint256) ToHex(f goja.FunctionCall, vm *goja.Runtime) goja.Value

func (Uint256) ToS256

func (u Uint256) ToS256() Sint256

func (Uint256) ToSafeInteger

func (u Uint256) ToSafeInteger() int64

func (Uint256) UnsafeAdd

func (u Uint256) UnsafeAdd(v Uint256) Uint256

func (Uint256) UnsafeMul

func (u Uint256) UnsafeMul(v Uint256) Uint256

func (Uint256) UnsafeSub

func (u Uint256) UnsafeSub(v Uint256) Uint256

Jump to

Keyboard shortcuts

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