optime

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoLocation

type GeoLocation struct {
	Latitude  float64
	Longitude float64
}

GeoLocation is a struct to hold latitude and longitude

type NowParameter

type NowParameter struct {
	Format *string
}

NowParameter is a struct to hold the format to use

type OpTime

type OpTime struct {
}

func (*OpTime) IsDay

func (o *OpTime) IsDay(ctx *base.Context, input *base.OperatorIO, g GeoLocation) *base.OperatorIO

IsDay returns the SunriseOutput for the given location if it is day, otherwise an error

func (*OpTime) IsNight

func (o *OpTime) IsNight(ctx *base.Context, input *base.OperatorIO, g GeoLocation) *base.OperatorIO

IsNight returns the SunriseOutput for the given location if it is night, otherwise an error

func (*OpTime) IsTimeOfDay

func (o *OpTime) IsTimeOfDay(ctx *base.Context, input *base.OperatorIO, t TimeOfDayParameter) *base.OperatorIO

IsTimeOfDay returns true if the current time is within the given range

func (*OpTime) IsTimeOfYear

func (o *OpTime) IsTimeOfYear(ctx *base.Context, input *base.OperatorIO, t TimeOfYearParameter) *base.OperatorIO

IsTimeOfYear returns true if the current date is within the given range

func (*OpTime) Now

func (o *OpTime) Now(ctx *base.Context, input *base.OperatorIO, n NowParameter) *base.OperatorIO

Now returns the current time

func (*OpTime) Sleep

func (o *OpTime) Sleep(ctx *base.Context, input *base.OperatorIO, s SleepParameter) *base.OperatorIO

Sleep sleeps for the given duration unless aborted

func (*OpTime) Sunrise

func (o *OpTime) Sunrise(ctx *base.Context, input *base.OperatorIO, g GeoLocation) *base.OperatorIO

Sunrise returns the SunriseOutput for the given location

type SleepParameter

type SleepParameter struct {
	Duration time.Duration
}

SleepParameter is a struct to hold the duration to sleep

type SunriseOutput

type SunriseOutput struct {
	Begin     time.Time
	End       time.Time
	Phase     string
	Latitude  float64
	Longitude float64
	Since     time.Duration
	Until     time.Duration
}

SunriseOutput is a struct to hold the sunrise information

type TimeOfDayParameter

type TimeOfDayParameter struct {
	StartHour   int
	StartMinute int
	EndHour     int
	EndMinute   int
}

TimeOfDayParameter is a struct to hold the start and end of a range in hours and minutes

type TimeOfYearParameter

type TimeOfYearParameter struct {
	StartMonth time.Month
	StartDay   int
	EndMonth   time.Month
	EndDay     int
}

TimeOfYearParameter is a struct to hold the start and end of a date range

Jump to

Keyboard shortcuts

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