func (q *Query) AndBrackets(builder QueryBuilder) QueryBuilder {
	q.andBrackets = append(q.andBrackets, builder)
	return q
}
AndBrackets AND (...)
package influxquerybuilder
import (
	"bytes"
	"fmt"
	"regexp"
	"strings"
)
type Duration interface {
	Nanoseconds(uint) Duration
	Microseconds(uint) Duration
	Milliseconds(uint) Duration
	Second(uint) Duration
	Minute(uint) Duration
	Hour(uint) Duration
	Day(uint) Duration
	Week(uint) Duration
	getDuration() string
}
type DurationType struct {
	unit  string
	value uint
}
func NewDuration() Duration {
	return &DurationType{}
}
func (t *DurationType) Nanoseconds(d uint) Duration {
	t.unit = "ns"
	t.value = d
	return t
}
func (t *DurationType) Microseconds(d uint) Duration {
	t.unit = "u"
	t.value = d
	return t
}
func (t *DurationType) Milliseconds(d uint) Duration {
	t.unit = "ms"
	t.value = d
	return t
}
func (t *DurationType) Second(d uint) Duration {
	t.unit = "s"
	t.value = d
	return t
}
func (t *DurationType) Minute(d uint) Duration {
	t.unit = "m"
	t.value = d
	return t
}
func (t *DurationType) Hour(d uint) Duration {
	t.unit = "h"
	t.value = d
	return t
}
func (t *DurationType) Day(d uint) Duration {
	t.unit = "d"
	t.value = d
	return t
}
func (t *DurationType) Week(d uint) Duration {
	t.unit = "w"
	t.value = d
	return t
}
func (t *DurationType) getDuration() string {
	return fmt.Sprintf("time(%d%s)", t.value, t.unit)
}
type QueryBuilder interface {
	Select(fields ...string) QueryBuilder
	From(string) QueryBuilder
	Where(string, string, interface{}) QueryBuilder
	And(string, string, interface{}) QueryBuilder
	Or(string, string, interface{}) QueryBuilder
	WhereBrackets(QueryBuilder) QueryBuilder
	AndBrackets(QueryBuilder) QueryBuilder
	OrBrackets(QueryBuilder) QueryBuilder
	GroupBy(string) QueryBuilder
	GroupByTime(Duration) QueryBuilder
	GroupByTag(string) QueryBuilder
	Fill(interface{}) QueryBuilder
	Limit(uint) QueryBuilder
	Offset(uint) QueryBuilder
	Desc() QueryBuilder
	Asc() QueryBuilder
	Build() string
	Clean() QueryBuilder
	GetQueryStruct() CurrentQuery
}
type Tag struct {
	key   string
	op    string
	value interface{}
}
type Query struct {
	measurement   string
	fields        []string
	where         Tag
	and           []Tag
	or            []Tag
	whereBrackets QueryBuilder
	andBrackets   []QueryBuilder
	orBrackets    []QueryBuilder
	groupBy       string
	groupByTime   string
	groupByTag    string
	order         string
	limit         uint
	_limit        bool
	offset        uint
	_offset       bool
	fill          interface{}
}
type CurrentQuery struct {
	Measurement   string
	Where         Tag
	And           []Tag
	Or            []Tag
	WhereBrackets QueryBuilder
	AndBrackets   []QueryBuilder
	OrBrackets    []QueryBuilder
	Fields        []string
	GroupBy       string
	GroupByTime   string
	GroupByTag    string
	Limit         uint
	Offset        uint
	Order         string
	IsLimitSet    bool
	IsOffsetSet   bool
}
func New() QueryBuilder {
	return &Query{}
}
func (q *Query) Clean() QueryBuilder {
	return New()
}
func (q *Query) Select(fields ...string) QueryBuilder {
	q.fields = append(q.fields, fields...)
	return q
}
func (q *Query) From(measurement string) QueryBuilder {
	q.measurement = measurement
	return q
}
func (q *Query) Where(key string, op string, value interface{}) QueryBuilder {
	q.where = Tag{key, op, value}
	return q
}
func (q *Query) And(key string, op string, value interface{}) QueryBuilder {
	q.and = append(q.and, Tag{key, op, value})
	return q
}
func (q *Query) Or(key string, op string, value interface{}) QueryBuilder {
	q.or = append(q.or, Tag{key, op, value})
	return q
}
func (q *Query) WhereBrackets(builder QueryBuilder) QueryBuilder {
	q.whereBrackets = builder
	return q
}