utils

package
v0.0.0-...-2251682 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DevopsGenerator

type DevopsGenerator interface {
	GenerateEmptyQuery() query.Query
}

DevopsGenerator is query generator for a database type that handles the Devops use case

type QueryFiller

type QueryFiller interface {
	// Fill fills in the query.Query with query details
	Fill(query.Query) query.Query
}

QueryFiller describes a type that can fill in a query and return it

type QueryFillerMaker

type QueryFillerMaker func(DevopsGenerator) QueryFiller

QueryFillerMaker is a function that takes a DevopsGenerator and returns a QueryFiller

type TimeInterval

type TimeInterval struct {
	Start, End time.Time
}

TimeInterval represents an interval of time.

func NewTimeInterval

func NewTimeInterval(start, end time.Time) TimeInterval

NewTimeInterval constructs a TimeInterval.

func (*TimeInterval) Duration

func (ti *TimeInterval) Duration() time.Duration

Duration converts a TimeInterval to a time.Duration.

func (*TimeInterval) EndString

func (ti *TimeInterval) EndString() string

EndString formats the end of the time interval.

func (*TimeInterval) EndUnixNano

func (ti *TimeInterval) EndUnixNano() int64

EndUnixNano returns the end time as nanoseconds.

func (*TimeInterval) RandWindow

func (ti *TimeInterval) RandWindow(window time.Duration) TimeInterval

RandWindow creates a TimeInterval of duration `window` at a uniformly-random start time within this time interval.

func (*TimeInterval) StartString

func (ti *TimeInterval) StartString() string

StartString formats the start of the time interval.

func (*TimeInterval) StartUnixNano

func (ti *TimeInterval) StartUnixNano() int64

StartUnixNano returns the start time as nanoseconds.

Jump to

Keyboard shortcuts

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