query

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Op    string
	Key   string
	Value []string
}

func (*Filter) To

func (c *Filter) To() *Filter

func (*Filter) UnmarshalJSON

func (c *Filter) UnmarshalJSON(data []byte) error

type Filters

type Filters []*Filter

func (Filters) Translate

func (f Filters) Translate() Filters

type Interval

type Interval byte
const (
	Minute Interval = 1 + iota
	Hour
	Date
	Week
	Month
)

func (Interval) Format

func (i Interval) Format() string

func (Interval) Range

func (i Interval) Range(start, end time.Time, f func(time.Time) error) error

func (Interval) String

func (i Interval) String() string

type Period

type Period struct {
	Start, End time.Time
	Interval   Interval
}

type Query

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

func New

func New(u url.Values) *Query

func (*Query) All

func (q *Query) All() bool

func (*Query) Compare

func (q *Query) Compare() *Period

func (*Query) End

func (q *Query) End() time.Time

func (*Query) Filter

func (q *Query) Filter() Filters

func (*Query) From

func (q *Query) From() string

func (*Query) Interval

func (q *Query) Interval() Interval

func (*Query) Metric

func (q *Query) Metric() string

func (*Query) Realtime

func (q *Query) Realtime() bool

func (*Query) Start

func (q *Query) Start() time.Time

func (*Query) To

func (q *Query) To() string

func (*Query) With

func (q *Query) With(fs ...*Filter) *Query

Jump to

Keyboard shortcuts

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