datamanclient

package
v0.0.0-...-49e5460 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 2 Imported by: 0

README

# Dataman Client
This package contains the client for dataman. 

The client is modeled loosely after the golang http client, specifically that 
there is a client and a transport layer. This allows us to have consistent 
metrics/configs/etc with a single unified client, but allow us flexibility in
how we connect to dataman through the transport layer.


# Examples
There is a sub-package of "example_usage" with good examples of how to use 
these clients in golang.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Transport DatamanClientTransport
}

TODO: support per-query config? TODO support switching config in-flight? If so then we'll need to store a pointer to it in the context -- which would require implementing one ourself

func (*Client) DoQuery

func (d *Client) DoQuery(ctx context.Context, q *query.Query) (*query.Result, error)

DoQuery will execute a given query. This will return a (result, error) -- where the error is any transport level error (NOTE: any response errors due to the query will *not* be reported in this error, they will be in the normal Result.Error location)

func (*Client) DoStreamQuery

func (d *Client) DoStreamQuery(ctx context.Context, q *query.Query) (*query.ResultStream, error)

DoStreamQuery will execute a given query and stream the results back.

type DatamanClientTransport

type DatamanClientTransport interface {
	DoQuery(context.Context, *query.Query) (*query.Result, error)

	DoStreamQuery(context.Context, *query.Query) (*query.ResultStream, error)
}

Interface for all dataman client access This includes clients that access the datasource directly etc.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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