Documentation ¶
Index ¶
- Variables
- func CompareRawdataWithInfluxResults(readRawdata *Common.ReadRawdata, results []Client.Result) error
- func InfluxResultToReadRawdata(results []Client.Result, query *Common.Query) *Common.ReadRawdata
- func ReadRawdata(config *Config, queries []*Common.Query) ([]*Common.ReadRawdata, error)
- func WriteRawdata(config *Config, writeRawdata []*Common.WriteRawdata) error
- type Config
- type Database
- type InfluxClient
- func (p *InfluxClient) CreateDatabase(db string) error
- func (p *InfluxClient) DeleteDatabase(db string) error
- func (p *InfluxClient) DeleteMeasurement(db, measurement string) error
- func (p *InfluxClient) ModifyDefaultRetentionPolicy(db string) error
- func (p *InfluxClient) Ping() error
- func (p *InfluxClient) QueryDB(cmd, database string) (res []Client.Result, err error)
- func (p *InfluxClient) WritePoints(points []*Client.Point, bpCfg Client.BatchPointsConfig) error
- type InfluxEntity
- type InfluxRow
- type Measurement
- type Statement
- func (s *Statement) AppendWhereClause(key string, operator string, value string)
- func (s *Statement) AppendWhereClauseByList(key string, operator string, listOperator string, values []string)
- func (s *Statement) AppendWhereClauseDirectly(condition string)
- func (s *Statement) AppendWhereClauseFromTimeCondition()
- func (s *Statement) AppendWhereClauseWithTime(operator string, value int64)
- func (s Statement) BuildQueryCmd() string
- func (s *Statement) SetLimitClauseFromQueryCondition()
- func (s *Statement) SetOrderClauseFromQueryCondition()
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ZeroTime is used as a constant of timestamp ZeroTime = time.Unix(0, 0) )
Functions ¶
func CompareRawdataWithInfluxResults ¶
func CompareRawdataWithInfluxResults(readRawdata *Common.ReadRawdata, results []Client.Result) error
func ReadRawdata ¶
func WriteRawdata ¶
func WriteRawdata(config *Config, writeRawdata []*Common.WriteRawdata) error
Types ¶
type Config ¶
type Config struct { Address string `mapstructure:"address"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` InsecureSkipVerify bool `mapstructure:"insecureSkipVerify"` RetentionDuration string `mapstructure:"retentionDuration"` RetentionShardDuration string `mapstructure:"retentionShardDuration"` }
Configuration of InfluxDB data source
type InfluxClient ¶
type InfluxClient struct { Address string Username string Password string RetentionDuration string RetentionShardDuration string }
InfluxDB client interacts with database
func NewClient ¶
func NewClient(influxCfg *Config) *InfluxClient
Instance InfluxDB API client with configuration
func (*InfluxClient) CreateDatabase ¶
func (p *InfluxClient) CreateDatabase(db string) error
Create database
func (*InfluxClient) DeleteDatabase ¶ added in v0.9.1
func (p *InfluxClient) DeleteDatabase(db string) error
Delete database
func (*InfluxClient) DeleteMeasurement ¶ added in v0.9.1
func (p *InfluxClient) DeleteMeasurement(db, measurement string) error
Delete measurement
func (*InfluxClient) ModifyDefaultRetentionPolicy ¶
func (p *InfluxClient) ModifyDefaultRetentionPolicy(db string) error
Modify default retention policy
func (*InfluxClient) Ping ¶ added in v0.9.1
func (p *InfluxClient) Ping() error
func (*InfluxClient) QueryDB ¶
func (p *InfluxClient) QueryDB(cmd, database string) (res []Client.Result, err error)
Query database
func (*InfluxClient) WritePoints ¶
func (p *InfluxClient) WritePoints(points []*Client.Point, bpCfg Client.BatchPointsConfig) error
Write points to database
type InfluxEntity ¶
type InfluxRow ¶
func NormalizeResult ¶
func ReadRawdataToInfluxDBRow ¶
func ReadRawdataToInfluxDBRow(readRawdata *Common.ReadRawdata) []*InfluxRow
type Measurement ¶
type Measurement string
type Statement ¶
type Statement struct { QueryCondition *DBCommon.QueryCondition Database Database Measurement Measurement SelectedFields []string GroupByTags []string WhereClause string OrderClause string LimitClause string }
func NewStatement ¶
func (*Statement) AppendWhereClause ¶
func (*Statement) AppendWhereClauseByList ¶ added in v0.3.53
func (*Statement) AppendWhereClauseDirectly ¶
func (*Statement) AppendWhereClauseFromTimeCondition ¶
func (s *Statement) AppendWhereClauseFromTimeCondition()
func (*Statement) AppendWhereClauseWithTime ¶
func (Statement) BuildQueryCmd ¶
func (*Statement) SetLimitClauseFromQueryCondition ¶
func (s *Statement) SetLimitClauseFromQueryCondition()
func (*Statement) SetOrderClauseFromQueryCondition ¶
func (s *Statement) SetOrderClauseFromQueryCondition()
Click to show internal directories.
Click to hide internal directories.