models

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseWeekday

func ParseWeekday(wdStr string) (time.Weekday, error)

Types

type CheckRequest

type CheckRequest struct {
	Source  Source  `json:"source"`
	Version Version `json:"version"`
}

type CheckResponse

type CheckResponse []Version

type InRequest

type InRequest struct {
	Source  Source  `json:"source"`
	Version Version `json:"version"`
}

type InResponse

type InResponse struct {
	Version  Version  `json:"version"`
	Metadata Metadata `json:"metadata"`
}

type Interval

type Interval time.Duration

func (Interval) MarshalJSON

func (i Interval) MarshalJSON() ([]byte, error)

func (*Interval) UnmarshalJSON

func (i *Interval) UnmarshalJSON(payload []byte) error

type Location

type Location time.Location

func (Location) MarshalJSON

func (l Location) MarshalJSON() ([]byte, error)

func (*Location) UnmarshalJSON

func (l *Location) UnmarshalJSON(payload []byte) error

type Metadata

type Metadata []MetadataField

type MetadataField

type MetadataField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type OutRequest

type OutRequest struct {
	Source Source `json:"source"`
}

type OutResponse

type OutResponse struct {
	Version  Version  `json:"version"`
	Metadata Metadata `json:"metadata"`
}

type Source

type Source struct {
	InitialVersion bool        `json:"initial_version"`
	Interval       *Interval   `json:"interval"`
	Start          *TimeOfDay  `json:"start"`
	Stop           *TimeOfDay  `json:"stop"`
	Days           []Weekday   `json:"days"`
	Location       *Location   `json:"location"`
	StartAfter     *StartAfter `json:"start_after"`
}

func (Source) Validate

func (source Source) Validate() error

type StartAfter added in v1.10.0

type StartAfter time.Time

func (StartAfter) MarshalJSON added in v1.10.0

func (sa StartAfter) MarshalJSON() ([]byte, error)

func (*StartAfter) UnmarshalJSON added in v1.10.0

func (sa *StartAfter) UnmarshalJSON(payload []byte) error

type TimeOfDay

type TimeOfDay time.Duration

func NewTimeOfDay

func NewTimeOfDay(t time.Time) TimeOfDay

func (TimeOfDay) Hour

func (tod TimeOfDay) Hour() int

func (TimeOfDay) MarshalJSON

func (tod TimeOfDay) MarshalJSON() ([]byte, error)

func (TimeOfDay) Minute

func (tod TimeOfDay) Minute() int

func (TimeOfDay) String

func (tod TimeOfDay) String() string

func (*TimeOfDay) UnmarshalJSON

func (tod *TimeOfDay) UnmarshalJSON(payload []byte) error

type Version

type Version struct {
	Time time.Time `json:"time"`
}

type Weekday

type Weekday time.Weekday

func (Weekday) MarshalJSON

func (wd Weekday) MarshalJSON() ([]byte, error)

func (*Weekday) UnmarshalJSON

func (x *Weekday) UnmarshalJSON(payload []byte) error

Jump to

Keyboard shortcuts

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