Help us shape the future of Go! Take the 2026 Go Developer Survey

influxdb

package module
v0.0.0-...-8b71952 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2014 License: MIT Imports: 8 Imported by: 2

README

influxdb-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

func (*Client) AlterDatabasePrivilege

func (self *Client) AlterDatabasePrivilege(database, name string, isAdmin bool, permissions ...string) error

func (*Client) AuthenticateClusterAdmin

func (self *Client) AuthenticateClusterAdmin(username, password string) error

func (*Client) AuthenticateDatabaseUser

func (self *Client) AuthenticateDatabaseUser(database, username, password string) error

func (*Client) ChangeClusterAdminPassword

func (self *Client) ChangeClusterAdminPassword(name, newPassword string) error

Change the cluster admin password

func (*Client) ChangeDatabaseUser

func (self *Client) ChangeDatabaseUser(database, name, newPassword string, isAdmin bool, newPermissions ...string) error

Change the user password, adming flag and optionally permissions

func (*Client) CreateClusterAdmin

func (self *Client) CreateClusterAdmin(name, password string) error

func (*Client) CreateDatabase

func (self *Client) CreateDatabase(name string) error

func (*Client) CreateDatabaseUser

func (self *Client) CreateDatabaseUser(database, name, password string, permissions ...string) error

Creates a new database user for the given database. permissions can be omitted in which case the user will be able to read and write to all time series. If provided, there should be two strings, the first for read and the second for write. The strings are regexes that are used to match the time series name to determine whether the user has the ability to read/write to the given time series.

client.CreateDatabaseUser("db", "user", "pass")
// the following user cannot read from any series and can write
// to the limited time series only
client.CreateDatabaseUser("db", "limited", "pass", "^$", "limited")

func (*Client) DeleteClusterAdmin

func (self *Client) DeleteClusterAdmin(name string) error

func (*Client) DeleteContinuousQueries

func (self *Client) DeleteContinuousQueries(id int) error

func (*Client) DeleteDatabase

func (self *Client) DeleteDatabase(name string) error

func (*Client) DeleteDatabaseUser

func (self *Client) DeleteDatabaseUser(database, name string) error

func (*Client) DisableCompression

func (self *Client) DisableCompression()

func (*Client) DropShard

func (self *Client) DropShard(id uint32, serverIds []uint32) error

func (*Client) GetClusterAdminList

func (self *Client) GetClusterAdminList() ([]map[string]interface{}, error)

func (*Client) GetContinuousQueries

func (self *Client) GetContinuousQueries() ([]map[string]interface{}, error)

func (*Client) GetDatabaseList

func (self *Client) GetDatabaseList() ([]map[string]interface{}, error)

func (*Client) GetDatabaseUserList

func (self *Client) GetDatabaseUserList(database string) ([]map[string]interface{}, error)

func (*Client) GetShards

func (self *Client) GetShards() (*LongTermShortTermShards, error)

func (*Client) Ping

func (self *Client) Ping() error

func (*Client) Query

func (self *Client) Query(query string, precision ...TimePrecision) ([]*Series, error)

func (*Client) QueryStream

func (self *Client) QueryStream(query string, out io.Writer, precision ...TimePrecision) error

func (*Client) QueryWithNumbers

func (self *Client) QueryWithNumbers(query string, precision ...TimePrecision) ([]*Series, error)

func (*Client) RemoveServer

func (self *Client) RemoveServer(id int) error

func (*Client) Servers

func (self *Client) Servers() ([]map[string]interface{}, error)

func (*Client) UpdateClusterAdmin

func (self *Client) UpdateClusterAdmin(name, password string) error

func (*Client) UpdateDatabaseUser

func (self *Client) UpdateDatabaseUser(database, name, password string) error

func (*Client) UpdateDatabaseUserPermissions

func (self *Client) UpdateDatabaseUserPermissions(database, name, readPermission, writePermissions string) error

func (*Client) WriteSeries

func (self *Client) WriteSeries(series []*Series) error

func (*Client) WriteSeriesWithTimePrecision

func (self *Client) WriteSeriesWithTimePrecision(series []*Series, timePrecision TimePrecision) error

type ClientConfig

type ClientConfig struct {
	Host       string
	Username   string
	Password   string
	Database   string
	HttpClient *http.Client
	IsSecure   bool
}

type LongTermShortTermShards

type LongTermShortTermShards struct {
	LongTerm  []*Shard `json:"longTerm"`
	ShortTerm []*Shard `json:"shortTerm"`
}

type Series

type Series struct {
	Name    string          `json:"name"`
	Columns []string        `json:"columns"`
	Points  [][]interface{} `json:"points"`
}

func (*Series) GetColumns

func (self *Series) GetColumns() []string

func (*Series) GetName

func (self *Series) GetName() string

func (*Series) GetPoints

func (self *Series) GetPoints() [][]interface{}

type Shard

type Shard struct {
	Id        uint32   `json:"id"`
	EndTime   int64    `json:"endTime"`
	StartTime int64    `json:"startTime"`
	ServerIds []uint32 `json:"serverIds"`
}

type TimePrecision

type TimePrecision string
const (
	Second      TimePrecision = "s"
	Millisecond TimePrecision = "m"
	Microsecond TimePrecision = "u"
)

Jump to

Keyboard shortcuts

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