client

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenWSClientConn

func OpenWSClientConn(url string, config *tls.Config) (*websocket.Conn, error)

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) CallViewWithContext

func (c *Client) CallViewWithContext(ctx context.Context, fid string, in []byte) (interface{}, error)

func (*Client) Initiate

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

func (*Client) Metrics

func (c *Client) Metrics() (map[string]*dto.MetricFamily, error)

func (*Client) StreamCallView

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

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

func (c *Config) WebURL() string

func (*Config) WsURL

func (c *Config) WsURL() string

type Input

type Input = server.Input

type Output

type Output = server.Output

type WSStream

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

func NewWSStream

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

func (*WSStream) Close

func (c *WSStream) Close() error

func (*WSStream) Recv

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

func (*WSStream) Result

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

func (*WSStream) Send

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

func (*WSStream) SendInput

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