timetunnel

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pass

func Pass(t Tunnel, opts ...Options)

Pass 执行时间隧道检查 Pass performs time tunnel check

Types

type EmptyTunnel

type EmptyTunnel struct{}

func (*EmptyTunnel) GetTouchedAt

func (e *EmptyTunnel) GetTouchedAt() time.Time

func (*EmptyTunnel) OnDayPassed

func (e *EmptyTunnel) OnDayPassed()

func (*EmptyTunnel) OnHourPassed

func (e *EmptyTunnel) OnHourPassed()

func (*EmptyTunnel) OnMinutePassed

func (e *EmptyTunnel) OnMinutePassed()

func (*EmptyTunnel) OnMonthPassed

func (e *EmptyTunnel) OnMonthPassed()

func (*EmptyTunnel) OnWeekPassed

func (e *EmptyTunnel) OnWeekPassed()

func (*EmptyTunnel) SetTouchedAt

func (e *EmptyTunnel) SetTouchedAt(t time.Time)

type Options

type Options func(t *tunnel)

func WithCurrentTime

func WithCurrentTime(currentTime time.Time) Options

WithCurrentTime 设置当前时间选项 WithCurrentTime sets the current time option

func WithWeekStartsAt

func WithWeekStartsAt(weekStartsAt string) Options

WithWeekStartsAt 设置周起始日选项 WithWeekStartsAt sets the week start day option

type Period

type Period string
const (
	Monthly  Period = "monthly"
	Weekly   Period = "weekly"
	Daily    Period = "daily"
	Hourly   Period = "hourly"
	Minutely Period = "minutely"
)

type Tunnel

type Tunnel interface {
	GetTouchedAt() time.Time
	SetTouchedAt(time.Time)
	OnMinutePassed()
	OnHourPassed()
	OnDayPassed()
	OnWeekPassed()
	OnMonthPassed()
}

Jump to

Keyboard shortcuts

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