dappclient

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppClient

type AppClient interface {
	WriteMessage(ctx context.Context, channel string, msg interface{}) error
	ReadMessage(ctx context.Context, channel string, message interface{}) error
	CommitMessage(ctx context.Context, channel string) error
}

AppClient defines an interface and its methods for a dApp Client

type Client

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

Client is the struct which implements the methods of AppClient interface

func NewAppClient

func NewAppClient() *Client

NewAppClient returns a new instance of the client of the AppClient package

func (*Client) HandleChannel

func (c *Client) HandleChannel(channel string, handler func(ctx context.Context, body io.Reader) error)

HandleChannel handles messages received in a given channel.

func (*Client) Run

func (c *Client) Run(ctx context.Context) error

Run runs the server with the handlers defined in HandleChannel

func (*Client) WriteMessage

func (c *Client) WriteMessage(ctx context.Context, channel string, msg interface{}) error

WriteMessage receives a channel and a message and sends it in a request to the sidecar server

Jump to

Keyboard shortcuts

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