web

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

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
}

Client models a client for an FSC node

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient returns a new web client

func (*Client) CallView

func (c *Client) CallView(fid string, in []byte) (interface{}, error)

CallView takes in input a view factory identifier, fid, and an input, in, and invokes the factory f bound to fid on input in. The view returned by the factory is invoked on a freshly created context. This call is blocking until the result is produced or an error is returned.

func (*Client) Initiate

func (c *Client) Initiate(fid string, in []byte) (string, error)

func (*Client) IsTxFinal

func (c *Client) IsTxFinal(txid string, opts ...api.ServiceOption) error

func (*Client) ServerVersion added in v0.2.0

func (c *Client) ServerVersion() (string, error)

func (*Client) StreamCallView added in v0.3.0

func (c *Client) StreamCallView(fid string, in []byte) (*WSStream, error)

func (*Client) Track

func (c *Client) Track(cid string) string

type Config

type Config struct {
	// Host to connect to
	Host string
	// CACertRaw is the certificate authority's certificates
	CACertRaw []byte
	// CACertPath is the Certificate Authority Cert Path
	CACertPath string
	// TLSCertPath is the TLS client certificate path
	TLSCertPath string
	// TLSKeyPath is the TLS client key path
	TLSKeyPath string
}

Config models the configuration for the web client

func (*Config) WebURL added in v0.3.0

func (c *Config) WebURL() string

func (*Config) WsURL added in v0.3.0

func (c *Config) WsURL() string

type Input added in v0.3.0

type Input = web.Input

type Output added in v0.3.0

type Output = web.Output

type WSStream added in v0.3.0

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

func NewWSStream added in v0.3.0

func NewWSStream(url string, config *tls.Config) (*WSStream, error)

func (*WSStream) Close added in v0.3.0

func (c *WSStream) Close() error

func (*WSStream) Recv added in v0.3.0

func (c *WSStream) Recv(v interface{}) error

func (*WSStream) Result added in v0.3.0

func (c *WSStream) Result() ([]byte, error)

func (*WSStream) Send added in v0.3.0

func (c *WSStream) Send(v interface{}) error

func (*WSStream) SendInput added in v0.3.0

func (c *WSStream) SendInput(in []byte) error

Jump to

Keyboard shortcuts

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