Documentation ¶
Index ¶
- Constants
- Variables
- func FieldsIgnored(fields Fields) error
- func FormatSource(source Source) string
- type CombinedFieldSource
- type ExprFieldSource
- type ExprSource
- type Field
- type FieldSource
- type Fields
- type FlatRow
- type FlatRowSource
- type GroupBy
- type GroupOpts
- type OnFields
- type OnFlatRow
- type OnRow
- type OrderBy
- type RowSource
- type Source
- type StaticFieldSource
- type TimeoutGuard
- type Transform
- type Vals
Constants ¶
const (
// HavingFieldName is the name of the synthetic field for the HAVING clause.
HavingFieldName = "_having"
)
Variables ¶
var ( // ErrDeadlineExceeded indicates that the deadline for iterating has been // exceeded. Results may be incomplete. ErrDeadlineExceeded = errors.New("deadline exceeded") // PointsField is the synthetic field that counts number of submitted points. PointsField = NewField("_points", expr.SUM("_point")) )
var ( // ClusterCrosstab is the crosstab expression for crosstabs that come from an // contained Group By (i.e. from a cluster follower) ClusterCrosstab = goexpr.Param("_crosstab") )
Functions ¶
func FieldsIgnored ¶
FieldsIgnored is a placeholder for an OnFields that does nothing.
func FormatSource ¶
Types ¶
type CombinedFieldSource ¶
type CombinedFieldSource []FieldSource
CombinedFieldSource is a FieldSource that combines multiple FieldSources and ensures that a field is not repeated.
func (CombinedFieldSource) String ¶
func (cfs CombinedFieldSource) String() string
type ExprFieldSource ¶
type ExprFieldSource struct { Name string Expr ExprSource }
ExprFieldSource turns an ExprSource into a FieldSource with a single named field.
func (ExprFieldSource) String ¶
func (efs ExprFieldSource) String() string
type ExprSource ¶
ExprSource is a source of an expression based on some known Fields.
type Field ¶
Field is a named expr.Expr
type FieldSource ¶
FieldSource is a source of Fields based on some known Fields.
var PassthroughFieldSource FieldSource = passthroughFieldSource{}
PassthroughFieldSource simply passes through the known Fields.
type FlatRow ¶
type FlatRow struct { TS int64 Key bytemap.ByteMap // Values for each field Values []float64 // contains filtered or unexported fields }
type FlatRowSource ¶
type FlatRowSource interface { Source Iterate(ctx context.Context, onFields OnFields, onRow OnFlatRow) (metadata interface{}, err error) }
func FlatRowFilter ¶
func FlatRowFilter(source FlatRowSource, label string, include func(ctx context.Context, row *FlatRow, fields Fields) (*FlatRow, error)) FlatRowSource
func Flatten ¶
func Flatten(source RowSource) FlatRowSource
func Limit ¶
func Limit(source FlatRowSource, lim int) FlatRowSource
func Offset ¶
func Offset(source FlatRowSource, off int) FlatRowSource
func Sort ¶
func Sort(source FlatRowSource, by ...OrderBy) FlatRowSource
type GroupBy ¶
GroupBy is a named goexpr.Expr.
func NewGroupBy ¶
NewGroupBy is a convenience method for creating new GroupBys.
type OrderBy ¶
OrderBy specifies an element by whith to order (element being ither a field name or the name of a dimension in the row key).
func NewOrderBy ¶
type RowSource ¶
type RowSource interface { Source Iterate(ctx context.Context, onFields OnFields, onRow OnRow) (metadata interface{}, err error) }
func Unflatten ¶
func Unflatten(source FlatRowSource, fields FieldSource) RowSource
func UnflattenOptimized ¶
func UnflattenOptimized(source FlatRowSource) RowSource
type StaticFieldSource ¶
type StaticFieldSource Fields
StaticFieldSource is a FieldSource that always returns the same Fields.
func (StaticFieldSource) String ¶
func (sfs StaticFieldSource) String() string
type TimeoutGuard ¶
type TimeoutGuard interface { // TimedOut returns true if the context deadline has been exceeded. TimedOut() bool // Proceed returns false, ErrDeadlineExceeded if the context deadline has been // exceeded Proceed() (more bool, err error) // ProceedAfter returns origMore, origErr if origMore is false or origErr is // not nil, else behaves like Proceed() ProceedAfter(origMore bool, origErr error) (more bool, err error) }
TimeoutGuard provides the ability to guard against timeouts on a Context.
func Guard ¶
func Guard(ctx context.Context) TimeoutGuard
Guard creates a new TimeoutGuard for the given Context.