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 Field
- type Function
- type FunctionType
- type Functions
- type InfluxClient
- func (p *InfluxClient) CreateDatabase(db string, retry int) error
- func (p *InfluxClient) DeleteDatabase(db string) error
- func (p *InfluxClient) DeleteMeasurement(db, measurement string) error
- func (p *InfluxClient) MeasurementExist(db, measurement string) bool
- func (p *InfluxClient) ModifyDefaultRetentionPolicy(db string, retry int) 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(operator, key, op, value string)
- func (s *Statement) AppendWhereClauseByList(key string, operator string, listOperator string, values []string)
- func (s *Statement) AppendWhereClauseDirectly(operator, condition string)
- func (s *Statement) AppendWhereClauseFromTimeCondition()
- func (s *Statement) AppendWhereClauseWithTime(operator string, value int64)
- func (s *Statement) BuildDropCmd() string
- func (s *Statement) BuildQueryCmd() string
- func (s *Statement) Clear()
- func (s *Statement) GenerateCondition(keyList, valueList []string, op string) string
- func (s *Statement) GenerateConditionByList(conditionList []string, op string) string
- func (s *Statement) SetFunction(funcType FunctionType, funcName, target string)
- func (s *Statement) SetLimitClauseFromQueryCondition()
- func (s *Statement) SetOrderClauseFromQueryCondition()
- type Tag
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 Function ¶ added in v0.9.166
type Function struct { FuncType FunctionType FuncName string Target string }
type FunctionType ¶ added in v0.9.166
type FunctionType int
const ( NoneFunction FunctionType = iota Aggregate Select )
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, retry int) 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) MeasurementExist ¶ added in v0.9.166
func (p *InfluxClient) MeasurementExist(db, measurement string) bool
func (*InfluxClient) ModifyDefaultRetentionPolicy ¶
func (p *InfluxClient) ModifyDefaultRetentionPolicy(db string, retry int) 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 Function *Function WhereClause string TimeClause 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) BuildDropCmd ¶ added in v0.9.166
func (*Statement) BuildQueryCmd ¶
func (*Statement) GenerateCondition ¶ added in v0.9.166
func (*Statement) GenerateConditionByList ¶ added in v0.9.166
func (*Statement) SetFunction ¶ added in v0.9.166
func (s *Statement) SetFunction(funcType FunctionType, funcName, target string)
func (*Statement) SetLimitClauseFromQueryCondition ¶
func (s *Statement) SetLimitClauseFromQueryCondition()
func (*Statement) SetOrderClauseFromQueryCondition ¶
func (s *Statement) SetOrderClauseFromQueryCondition()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.