schedule

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package schedule decides when a node offers its models to the network: the owner's serving hours, such as overnight or at weekends. It knows only about the clock; the agent applies the answer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

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

Schedule is a set of serving windows in one time zone. A nil Schedule is always open, which is the agent's default.

func Parse

func Parse(specs []string, tz string) (*Schedule, error)

Parse reads windows of the form "22:00-07:00" (every day) or "mon-fri@20:00-07:00" and "sat,sun@00:00-24:00". An empty tz means the machine's local time; otherwise it is an IANA name such as "Asia/Dubai".

func (*Schedule) Next

func (s *Schedule) Next(t time.Time) (time.Time, bool)

Next returns the first minute after t at which Open changes, and false when it never does, as with every day 00:00-24:00.

func (*Schedule) Open

func (s *Schedule) Open(t time.Time) bool

Open reports whether the node should serve at t.

func (*Schedule) String

func (s *Schedule) String() string

String names the schedule for logs.

Jump to

Keyboard shortcuts

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