window

package
v0.10.3-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.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 Config

type Config struct {
	Preset string
	// kept for backward compatibility, will be changed to only v2 at some point
	Window models.Window
	// contains filtered or unexported fields
}

func NewCustomConfig

func NewCustomConfig(w models.Window) Config

func NewIncrementalConfig

func NewIncrementalConfig() Config

func NewPresetConfig

func NewPresetConfig(preset string) (Config, error)

func (Config) GetOffset

func (c Config) GetOffset() string

func (Config) GetSize

func (c Config) GetSize() string

func (Config) GetTruncateTo

func (c Config) GetTruncateTo() string

func (Config) GetVersion

func (c Config) GetVersion() int

func (Config) Type

func (c Config) Type() Type

type Interval

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

type Type

type Type string
const (
	Incremental Type = "incremental"
	Preset      Type = "preset"
	Custom      Type = "custom"
)

type Window

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

func From

func From[T WithWindow](config Config, schedule string, getter func(string) (T, error)) (Window, error)

func FromBaseWindow

func FromBaseWindow(w models.Window) Window

func FromSchedule

func FromSchedule(schedule string) (Window, error)

func (Window) GetInterval

func (w Window) GetInterval(referenceTime time.Time) (Interval, error)

type WithWindow

type WithWindow interface {
	Window() models.Window
}

Jump to

Keyboard shortcuts

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