Documentation ¶
Index ¶
- Constants
- type Client
- func (self *Client) AlterDatabasePrivilege(database, name string, isAdmin bool, permissions ...string) error
- func (self *Client) AuthenticateClusterAdmin(username, password string) error
- func (self *Client) AuthenticateDatabaseUser(database, username, password string) error
- func (self *Client) ChangeClusterAdminPassword(name, newPassword string) error
- func (self *Client) ChangeDatabaseUser(database, name, newPassword string, isAdmin bool, newPermissions ...string) error
- func (self *Client) CreateClusterAdmin(name, password string) error
- func (self *Client) CreateDatabase(name string) error
- func (self *Client) CreateDatabaseUser(database, name, password string, permissions ...string) error
- func (self *Client) CreateShardSpace(database string, space *ShardSpace) error
- func (self *Client) DeleteClusterAdmin(name string) error
- func (self *Client) DeleteDatabase(name string) error
- func (self *Client) DeleteDatabaseUser(database, name string) error
- func (self *Client) DisableCompression()
- func (self *Client) DropShard(id uint32, serverIds []uint32) error
- func (self *Client) DropShardSpace(database, name string) error
- func (self *Client) GetClusterAdminList() ([]map[string]interface{}, error)
- func (self *Client) GetDatabaseList() ([]map[string]interface{}, error)
- func (self *Client) GetDatabaseUserList(database string) ([]map[string]interface{}, error)
- func (self *Client) GetShardSpaces() ([]*ShardSpace, error)
- func (self *Client) GetShards() (*LongTermShortTermShards, error)
- func (self *Client) Ping() error
- func (self *Client) Query(query string, precision ...TimePrecision) ([]*Series, error)
- func (self *Client) QueryWithNumbers(query string, precision ...TimePrecision) ([]*Series, error)
- func (self *Client) RemoveServer(id int) error
- func (self *Client) Servers() ([]map[string]interface{}, error)
- func (self *Client) UpdateClusterAdmin(name, password string) error
- func (self *Client) UpdateDatabaseUser(database, name, password string) error
- func (self *Client) UpdateDatabaseUserPermissions(database, name, readPermission, writePermissions string) error
- func (self *Client) UpdateShardSpace(database, name string, space *ShardSpace) error
- func (self *Client) WriteSeries(series []*Series) error
- func (self *Client) WriteSeriesOverUDP(series []*Series) error
- func (self *Client) WriteSeriesWithTimePrecision(series []*Series, timePrecision TimePrecision) error
- type ClientConfig
- type LongTermShortTermShards
- type Series
- type Shard
- type ShardSpace
- type ShardSpaceCollection
- type TimePrecision
Constants ¶
View Source
const (
UDPMaxMessageSize = 2048
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *ClientConfig) (*Client, error)
func NewClient ¶
func NewClient(config *ClientConfig) (*Client, error)
func (*Client) AlterDatabasePrivilege ¶
func (*Client) AuthenticateClusterAdmin ¶
func (*Client) AuthenticateDatabaseUser ¶
func (*Client) ChangeClusterAdminPassword ¶
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 (*Client) CreateDatabase ¶
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) CreateShardSpace ¶
func (self *Client) CreateShardSpace(database string, space *ShardSpace) error
Added to InfluxDB in 0.8.0
func (*Client) DeleteClusterAdmin ¶
func (*Client) DeleteDatabase ¶
func (*Client) DeleteDatabaseUser ¶
func (*Client) DisableCompression ¶
func (self *Client) DisableCompression()
func (*Client) DropShardSpace ¶
Added to InfluxDB in 0.8.0
func (*Client) GetClusterAdminList ¶
func (*Client) GetDatabaseList ¶
func (*Client) GetDatabaseUserList ¶
func (*Client) GetShardSpaces ¶
func (self *Client) GetShardSpaces() ([]*ShardSpace, error)
Added to InfluxDB in 0.8.0
func (*Client) GetShards ¶
func (self *Client) GetShards() (*LongTermShortTermShards, error)
func (*Client) Query ¶
func (self *Client) Query(query string, precision ...TimePrecision) ([]*Series, error)
func (*Client) QueryWithNumbers ¶
func (self *Client) QueryWithNumbers(query string, precision ...TimePrecision) ([]*Series, error)
func (*Client) RemoveServer ¶
func (*Client) UpdateClusterAdmin ¶
func (*Client) UpdateDatabaseUser ¶
func (*Client) UpdateDatabaseUserPermissions ¶
func (*Client) UpdateShardSpace ¶ added in v0.8.2
func (self *Client) UpdateShardSpace(database, name string, space *ShardSpace) error
Added to InfluxDB in 0.8.2
func (*Client) WriteSeries ¶
func (*Client) WriteSeriesOverUDP ¶
func (*Client) WriteSeriesWithTimePrecision ¶
func (self *Client) WriteSeriesWithTimePrecision(series []*Series, timePrecision TimePrecision) error
type ClientConfig ¶
type LongTermShortTermShards ¶
type LongTermShortTermShards struct { // Long term shards, (doesn't get populated for version >= 0.8.0) LongTerm []*Shard `json:"longTerm"` // Short term shards, (doesn't get populated for version >= 0.8.0) ShortTerm []*Shard `json:"shortTerm"` // All shards in the system (Long + Short term shards for version < 0.8.0) All []*Shard `json:"-"` }
type Series ¶
type Series struct { Name string `json:"name"` Columns []string `json:"columns"` Points [][]interface{} `json:"points"` }
func (*Series) GetColumns ¶
type ShardSpace ¶
type ShardSpace struct { // required, must be unique within the database Name string `json:"name"` // required, a database has many shard spaces and a shard space belongs to a database Database string `json:"database"` // this is optional, if they don't set it, we'll set to /.*/ Regex string `json:"regex"` // this is optional, if they don't set it, it will default to the storage.dir in the config RetentionPolicy string `json:"retentionPolicy"` ShardDuration string `json:"shardDuration"` ReplicationFactor uint32 `json:"replicationFactor"` Split uint32 `json:"split"` }
type ShardSpaceCollection ¶
type ShardSpaceCollection struct {
ShardSpaces []ShardSpace
}
type TimePrecision ¶
type TimePrecision string
const ( Second TimePrecision = "s" Millisecond TimePrecision = "ms" Microsecond TimePrecision = "u" )
Click to show internal directories.
Click to hide internal directories.