client

package
v0.0.0-...-226beff Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Config is a client configuration
	Config
	// Client is a roundtrip client
	Client *roundtrip.Client
}

Client is an HTTP client sending the data to the IOT metric server

func New

func New(cfg Config) (*Client, error)

New returns a new client

func (*Client) Send

func (c *Client) Send(ctx context.Context, m metric.Metric) error

Send sends the metric to the IOT server

func (*Client) SendCorruptedData

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

SendCorruptedData sends corrupted non-json data to the server

type Config

type Config struct {
	// BearerToken is a bearer token
	// that is used to authenticate requests
	BearerToken string
	// URL is a URL to send the data to
	URL *url.URL
	// CACert is a certificate authority certificate
	CACert *x509.Certificate
}

Config is a client config

func (*Config) Check

func (c *Config) Check() error

Check checks configuration

Jump to

Keyboard shortcuts

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