httpclient

package
v0.0.0-...-2ecc45d Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(config ClientConfig, table, fields string, timeoutMs, maxRows uint, sync, persist bool, rows interface{}) error

Send creates Client inside and sends request to dbatcher. Use if you need to send single request or if performance is not a bottleneck.

Types

type Client

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

Client is a dbatcher's HTTP client

func NewClient

func NewClient(config ClientConfig) *Client

NewClient returns configured client

func (*Client) Close

func (c *Client) Close() error

Close closes connection to dbatcher

func (Client) Send

func (c Client) Send(table, fields string, timeoutMs, maxRows uint, sync, persist bool, rows interface{}) error

Send sends table parameters and rows to dbatcher. Rows must be slice of slices of primitives like int, float or string

type ClientConfig

type ClientConfig struct {
	ServerAddress string
	ReadTimeout   time.Duration
	WriteTimeout  time.Duration
}

ClientConfig is a config for cliet

Jump to

Keyboard shortcuts

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