models

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"`
}

func (Source) Validate

func (source Source) Validate() 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 ParseWeekday

func ParseWeekday(wdStr string) (Weekday, error)

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