mycenae

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 11 Imported by: 0

README

Mycenae Client

A client built to call the API services from the timeseries database Mycenae.

How to build:
  $ go mod vendor
  $ go build
How to execute the tests:

All tests are located in the directory "tests". They can be executed in the main suite file called "suite_test.go" or executing the script "run-tests.sh" located in the project root. Ex:

  $ ./run-tests.sh

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadRequest - raised when invalid parameters are passed
	ErrBadRequest error = errors.New("invalid parameters")

	// ErrNullConfiguration - raised when a null configuration is found
	ErrNullConfiguration error = errors.New("configuration is null")

	// ErrInvalidHost - raised when a host is invalid
	ErrInvalidHost error = errors.New("host is invalid")

	// ErrInvalidPort - raised when the port is invalid
	ErrInvalidPort error = errors.New("port is invalid")

	// ErrInvalidTimeout - raised when the timeout is invalid
	ErrInvalidTimeout error = errors.New("timeout is invalid")
)

Functions

This section is empty.

Types

type Client

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

Client - a mycenae client

func New

func New(configuration *Configuration) (*Client, error)

New - configures a new client

func (*Client) Close

func (c *Client) Close()

Close - close idle connections

func (*Client) DoJSONRequest

func (c *Client) DoJSONRequest(e *endpoint, uriParameters []interface{}, body interface{}, resultJSON interface{}) (status int, err error)

DoJSONRequest - creates a new GET request

func (*Client) GetKeysets

func (c *Client) GetKeysets() ([]string, error)

GetKeysets - return the list of all keysets

func (*Client) GetRawPoints

func (c *Client) GetRawPoints(query *raw.Query) (*raw.NumberQueryResults, error)

GetRawPoints - return the list of raw points

func (*Client) GetRawTextPoints

func (c *Client) GetRawTextPoints(query *raw.Query) (*raw.TextQueryResults, error)

GetRawTextPoints - return the list of raw text points

func (*Client) KeysetExists

func (c *Client) KeysetExists(keyset string) (bool, error)

KeysetExists - check if a keyset exists

type Configuration

type Configuration struct {
	Host    string         `json:"host"`
	Port    int            `json:"port"`
	Secure  bool           `json:"secure"`
	Timeout funks.Duration `json:"timeout"`
}

Configuration - client configurations

func (*Configuration) Validate added in v1.0.1

func (c *Configuration) Validate() error

Validate - validates the configuration parameters

Jump to

Keyboard shortcuts

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