mock

package
v0.0.0-...-6c78b00 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddArgs

type AddArgs struct {
	A, B int
}

AddArgs are an example of parameters for an addition receiver

func (AddArgs) MarshalMsg

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

MarshalMsg implements msgp.Marshaler

func (AddArgs) Msgsize

func (z AddArgs) Msgsize() (s int)

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

func (*AddArgs) UnmarshalMsg

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

UnmarshalMsg implements msgp.Unmarshaler

type AddResp

type AddResp struct {
	C int
}

AddResp is an example of the result of an addition receiver

func (AddResp) MarshalMsg

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

MarshalMsg implements msgp.Marshaler

func (AddResp) Msgsize

func (z AddResp) Msgsize() (s int)

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

func (*AddResp) UnmarshalMsg

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

UnmarshalMsg implements msgp.Unmarshaler

type AdderReceiver

type AdderReceiver struct {
	Args AddArgs
	Resp AddResp
}

AdderReceiver is an example of a receiver that simply adds two numbers.

func (*AdderReceiver) Binding

func (a *AdderReceiver) Binding() (codecs.RpcArgs, codecs.RpcResp)

Binding implements the wasmrpc.Receiver interface

func (*AdderReceiver) Execute

func (a *AdderReceiver) Execute(caller string, env *ArithmeticEnv, _ any) (err error)

Execute implements the wasmrpc.Receiver interface

type ArithmeticEnv

type ArithmeticEnv struct {
	LastCaller string
}

ArithmeticEnv is an example of a host environment used to store a persistent state between invocations of any receiver

Source Files

  • api.go
  • api_gen.go
  • service.go

Jump to

Keyboard shortcuts

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