common

package
v0.0.0-...-47c9800 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package common does the heavy lifting for proxima.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database represents a single proxima configuration.

func NewDatabase

func NewDatabase(db config.Database) (*Database, error)

func (*Database) Close

func (d *Database) Close() error

Close frees any resources associated with this instance.

func (*Database) Name

func (d *Database) Name() string

func (*Database) Query

func (d *Database) Query(
	query *influxql.Query,
	epoch string,
	now time.Time,
	logger log.Logger) (*client.Response, error)

Query runs a query against the influx backends and scotty servers in this proxima configuration.

type Influx

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

Influx represents a single influx backend.

func NewInflux

func NewInflux(influx config.Influx) (*Influx, error)

func (*Influx) Close

func (d *Influx) Close() error

Close frees any resources associated with this instance.

func (*Influx) Query

func (d *Influx) Query(
	query *influxql.Query, epoch string, logger log.Logger) (
	*client.Response, error)

Query runs a query against this backend.

type InfluxList

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

InfluxList represents a group of influx backends. nil represents the group of zero influx backends.

func NewInfluxList

func NewInfluxList(influxes config.InfluxList) (*InfluxList, error)

NewInfluxList returns a new instancce. If the length of influxes is 0, NewInfluxList returns nil.

func (*InfluxList) Close

func (l *InfluxList) Close() error

Close frees any resources associated with this instance.

func (*InfluxList) Query

func (l *InfluxList) Query(
	query *influxql.Query, epoch string, now time.Time, logger log.Logger) (
	*client.Response, error)

Query runs a query against the backends in this group merging the resuls into a single response.

type Proxima

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

Proxima represents all the configurations of a proxima application. A Proxima instance does the heavy lifting for the proxima application.

func NewProxima

func NewProxima(proxima config.Proxima) (*Proxima, error)

func (*Proxima) ByName

func (p *Proxima) ByName(name string) *Database

ByName returns the configuration with given name or nil if no such configuration exists.

func (*Proxima) Close

func (p *Proxima) Close() error

Close frees any resources associated with this instance.

func (*Proxima) Names

func (p *Proxima) Names() (result []string)

Names returns the names of all the configurations ordered alphabetically.

type Scotty

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

Scotty represents a single scotty server.

func NewScotty

func NewScotty(scotty config.Scotty) (*Scotty, error)

func (*Scotty) Close

func (s *Scotty) Close() error

Close frees any resources associated with this instance.

func (*Scotty) Query

func (s *Scotty) Query(
	query *influxql.Query, epoch string, logger log.Logger) (
	*client.Response, error)

type ScottyList

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

ScottyList represents a group of scotty servers. Unlike ScottyPartials, each Scotty has the same data only one scotty has to respond to each query. nil represents the group of zero scotty servers.

func NewScottyList

func NewScottyList(scotties config.ScottyList) (*ScottyList, error)

NewScottyList returns a new instancce. If the length of scotties is 0, NewScottyList returns nil.

func (*ScottyList) Close

func (l *ScottyList) Close() error

Close frees any resources associated with this instance.

func (*ScottyList) Query

func (l *ScottyList) Query(
	query *influxql.Query, epoch string, logger log.Logger) (
	*client.Response, error)

Query runs a query against the servers in this group merging the resuls into a single response.

type ScottyPartials

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

ScottyPartials represents a list of scotties where all the scotties together represent the data. All scotties must respond to each query.

func NewScottyPartials

func NewScottyPartials(scotties config.ScottyList) (*ScottyPartials, error)

func (*ScottyPartials) Close

func (l *ScottyPartials) Close() error

func (*ScottyPartials) Query

func (l *ScottyPartials) Query(
	query *influxql.Query, epoch string, logger log.Logger) (
	*client.Response, error)

Jump to

Keyboard shortcuts

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