model

package
v0.0.0-...-4308b5e Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Name        string       `json:"name"`
	Status      Status       `json:"status"`
	Description string       `json:"description,omitempty"`
	Puzzle      PuzzleSource `json:"puzzle"`
}

Channel is a representation of a channel and the puzzle that is being solved. It can be marshalled to/from JSON.

type Duration

type Duration struct {
	time.Duration
}

Duration is an aliasing of time.Duration that supports marshalling to/from JSON.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(bs []byte) error

type FontSize

type FontSize int

FontSize is an enumeration representing the supported sizes of a font. It can be marshalled to/from JSON as well as implements the fmt.Stringer interface for human readability.

const (
	FontSizeNormal FontSize = iota
	FontSizeLarge
	FontSizeXLarge
)

func (FontSize) MarshalJSON

func (s FontSize) MarshalJSON() ([]byte, error)

func (FontSize) String

func (s FontSize) String() string

func (*FontSize) UnmarshalJSON

func (s *FontSize) UnmarshalJSON(bs []byte) error

type PuzzleSource

type PuzzleSource struct {
	Publisher     string    `json:"publisher"`
	PublishedDate time.Time `json:"published"`
}

PuzzleSource is a representation of the source of a puzzle that's being solved. It can be marshalled to/from JSON.

type Status

type Status int

Status is an enumeration representing the supported statuses a channel can be in with respect to solving a puzzle. It can be marshalled to/from JSON as well as implements the fmt.Stringer interface for human readability.

const (
	// The channel exists, but a puzzle hasn't yet been selected.
	StatusCreated Status = iota

	// A puzzle has been selected, but not yet started.
	StatusSelected

	// The channel has a puzzle selected but is paused in its attempt to solve it.
	StatusPaused

	// The channel is actively trying to solve the puzzle.
	StatusSolving

	// The puzzle that was being solved is complete.
	StatusComplete
)

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

func (Status) String

func (s Status) String() string

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(bs []byte) error

Jump to

Keyboard shortcuts

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