deadline

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToTimespec

func ToTimespec(dl Deadline) (*unix.Timespec, error)

ToTimespec converts a Deadline to a unix.Timespec. If the Deadline has a valid, non-zero deadline, it converts the deadline time to a Timespec. Returns nil if no deadline is set or if the deadline is zero.

Types

type Deadline

type Deadline interface {
	Deadline() (time.Time, bool)
}

Deadline is an interface representing something that may provide a deadline. Examples include context.Context or testing.T.

type NoDeadline

type NoDeadline struct{}

NoDeadline is a type that implements the Deadline interface but always indicates no deadline.

func (NoDeadline) Deadline

func (NoDeadline) Deadline() (_ time.Time, _ bool)

type TimeDeadline

type TimeDeadline time.Time

TimeDeadline contains a simple time.Time value and indicates a deadline if the time is not a zero value.

func (TimeDeadline) Deadline

func (td TimeDeadline) Deadline() (time.Time, bool)

Jump to

Keyboard shortcuts

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