sdk

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MPL-2.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(hmxURL string) *Client

func (*Client) BalanceOf

func (c *Client) BalanceOf(accid string) (amt *big.Int, err error)

func (*Client) Callback added in v0.1.1

func (c *Client) Callback(targetURL string) (res string, err error)

func (*Client) Close

func (c *Client) Close()

func (*Client) GetAssignByMessage

func (c *Client) GetAssignByMessage(msgid string) (item goarSchema.BundleItem, err error)

func (*Client) GetAssignByNonce

func (c *Client) GetAssignByNonce(pid string, nonce int64) (item goarSchema.BundleItem, err error)

func (*Client) GetCache added in v0.4.0

func (c *Client) GetCache(pid, key string) (value string, err error)

func (*Client) GetMessage

func (c *Client) GetMessage(msgid string) (item goarSchema.BundleItem, err error)

func (*Client) GetMessageByNonce

func (c *Client) GetMessageByNonce(pid string, nonce int64) (item goarSchema.BundleItem, err error)

func (*Client) GetModule added in v0.3.2

func (c *Client) GetModule(moduleId string) (module hymxSchema.Module, err error)

func (*Client) GetModules added in v0.4.0

func (c *Client) GetModules() (names []string, err error)

func (*Client) GetNode added in v0.4.0

func (c *Client) GetNode(accid string) (node *registrySchema.Node, err error)

func (*Client) GetNodes added in v0.4.0

func (c *Client) GetNodes() (nodes map[string]registrySchema.Node, err error)

func (*Client) GetNodesByProcess added in v0.4.0

func (c *Client) GetNodesByProcess(pid string) (nodes []registrySchema.Node, err error)

func (*Client) GetProcesses added in v0.4.0

func (c *Client) GetProcesses(accid string) (processes []string, err error)

func (*Client) GetResult

func (c *Client) GetResult(pid, msgid string) (result vmmSchema.VmmResult, err error)

func (*Client) GetResults

func (c *Client) GetResults(pid string, limit int64) (results serverSchema.ResponseResults, err error)

func (*Client) Info

func (c *Client) Info() (info nodeSchema.Info, err error)

func (*Client) Send

func (c *Client) Send(itemBin []byte) (res *serverSchema.Response, redirectedURL string, err error)

func (*Client) StakeOf

func (c *Client) StakeOf(accid string) (amt *big.Int, err error)

func (*Client) TrySend added in v0.4.0

func (c *Client) TrySend(pid, target string) (err error)

TrySend triggers outbox sending for a given pid and target. It posts JSON {pid, target} to /trysend and expects 2xx with empty body.

type SDK

type SDK struct {
	Bundler *goar.Bundler
	Client  *Client
}

func New

func New(nodeURL, keyPath string) *SDK

func NewFromBundler

func NewFromBundler(nodeURL string, bundler *goar.Bundler) *SDK

func (*SDK) Close

func (s *SDK) Close()

func (*SDK) GenerateModule

func (s *SDK) GenerateModule(moduleBytes []byte, module schema.Module) (item goarSchema.BundleItem, err error)

func (*SDK) GetAddress

func (s *SDK) GetAddress() string

func (*SDK) ResultAndWait

func (s *SDK) ResultAndWait(pid, msgid string) (result vmmSchema.VmmResult, err error)

func (*SDK) Send

func (s *SDK) Send(processId, data string, tags []goarSchema.Tag) (res *serverSchema.Response, redirectedURL string, err error)

func (*SDK) SendAndWait

func (s *SDK) SendAndWait(processId, data string, tags []goarSchema.Tag) (res *serverSchema.Response, err error)

func (*SDK) SendMessage

func (s *SDK) SendMessage(target, data string, params []goarSchema.Tag) (resp *serverSchema.Response, err error)

Send message to process

func (*SDK) SendMessageAndWait

func (s *SDK) SendMessageAndWait(target, data string, params []goarSchema.Tag) (*serverSchema.Response, error)

func (*SDK) Spawn

func (s *SDK) Spawn(module, scheduler string, params []goarSchema.Tag) (resp *serverSchema.Response, err error)

Spawn for process creation

func (*SDK) SpawnAndWait

func (s *SDK) SpawnAndWait(module, scheduler string, params []goarSchema.Tag) (*serverSchema.Response, error)

Jump to

Keyboard shortcuts

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