enum

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Contains all the preset enumerations as defined and used in the API.

Index

Constants

View Source
const (
	NoBool  = Bool("0")
	YesBool = Bool("1")
)

A boolean value is expressed as a 0 for `false` and 1 for `true`. String is used as type as it's not possible to nil integer values (which is needed in order to omit unset parameters as the query parameter).

View Source
const (
	WebpImageFormat = ImageFormat("webp")
	AvifImageFormat = ImageFormat("avif")
	// Will return a jpg, png or gif.
	ClassicImageFormat = ImageFormat("classic")
)

Used to state the desired image format of a requested image.

View Source
const (
	PlainFormat      = RichTextFormat("plain")
	CoverLinksFormat = RichTextFormat("converlinks")
	HtmlFormat       = RichTextFormat("html")
	XmlStrictFormat  = RichTextFormat("xmlstrict")
)

Possible rich text formats.

View Source
const (
	MetricUnit   = DistanceUnit("metric")
	ImperialUnit = DistanceUnit("imperial")
)

Metric or imperial distance units.

View Source
const (
	CelsiusUnit    = TemperatureUnit("celsius")
	FahrenheitUnit = TemperatureUnit("fahrenheit")
)

Metric or imperial temperature units.

View Source
const (
	AllGateway     = Gateway("all")
	DesktopGateway = Gateway("desktop")
	MobileGateway  = Gateway("mobile")
	SmartTvGateway = Gateway("smarttv")
	CarGateway     = Gateway("car")
)

Used in conjunction with [QueryParameters.ForceGateway].

View Source
const (
	AscendingOrder  = OrderDirection("ASC")
	DescendingOrder = OrderDirection("DESC")
)

Direction of ordering elements.

View Source
const (
	AllStreamType   = StreamType("allmedia")
	VideoStreamType = StreamType("videos")
	AudioStreamType = StreamType("audio")
	ShowStreamType  = StreamType("shows")
)

Streamtypes represent the different types of media items.

View Source
const (
	VideoContentType   = ContentType("video")
	ComicContentType   = ContentType("comic")
	CgiContentType     = ContentType("cgi")
	FotoContentType    = ContentType("foto")
	DrawingContentType = ContentType("drawing")
	ClipartContentType = ContentType("clipart")
)

The content types of media.

View Source
const (
	AgeRestriction0  = AgeRestriction("0")
	AgeRestriction6  = AgeRestriction("6")
	AgeRestriction12 = AgeRestriction("12")
	AgeRestriction16 = AgeRestriction("16")
	AgeRestriction18 = AgeRestriction("18")
)

The different age restrictions as defined by the FSK.

View Source
const (
	HdDimension     = Dimension("hd")
	FullHdDimension = Dimension("fullhd")
	I2kDimension    = Dimension("2K")
	I4kDimension    = Dimension("4K")
)

Geometric dimension of a media file.

View Source
const (
	PortraitOrientation  = Orientation("portrait")
	LandscapeOrientation = Orientation("landscape")
)

Media orientation.

View Source
const (
	FullOutputModifier    = OutputModifier("full")
	DefaultOutputModifier = OutputModifier("default")
	IdOutputModifier      = OutputModifier("ID")
	GidOutputModifier     = OutputModifier("GID")
)

Output modifier used to define the detail level.

View Source
const (
	RandomAutoFill    = AutoFill("random")
	LatestAutoFill    = AutoFill("latest")
	TopItemsAutoFill  = AutoFill("topitems")
	TopItemsExternal  = AutoFill("topitemsexternal")
	ForkIdsAutoFill   = AutoFill("forkids")
	EvergreenAutoFill = AutoFill("evergreen")
)

Method for the auto fill method of the API.

View Source
const (
	ClassicWithAndQueryMode = QueryMode("classicwithand")
	ClassicWithOrQueryMode  = QueryMode("classicwithor")
	FulltextQueryMode       = QueryMode("fulltext")
)

Query modes.

View Source
const (
	DeleteAfterRejection     = ActionAfterRejection("delete")
	ArchiveAfterRejection    = ActionAfterRejection("archive")
	BlockAfterRejection      = ActionAfterRejection("block")
	NewVersionAfterRejection = ActionAfterRejection("newversion")
)

Action after rejection of an item.

Variables

This section is empty.

Functions

func EnumByByteValue

func EnumByByteValue[T ~string](e Enum[T], value []byte) (*T, error)

Returns an Enum instance based on it's value from a byte slice.

func EnumByValue

func EnumByValue[T ~string](e Enum[T], value T) (*T, error)

Returns an Enum instance by it's value.

func EnumValues

func EnumValues[T ~string](e Enum[T]) []string

Returns all values of an Enum type.

Types

type ActionAfterRejection

type ActionAfterRejection string

Action after rejection of an item.

func (ActionAfterRejection) Instances

All instances of the ActionAfterRejection

func (*ActionAfterRejection) UnmarshalJSON

func (i *ActionAfterRejection) UnmarshalJSON(data []byte) (err error)

type AgeRestriction

type AgeRestriction string

Age categories for age restrictions.

func (AgeRestriction) Instances

func (i AgeRestriction) Instances() []AgeRestriction

All instances of the AgeRestriction

func (*AgeRestriction) UnmarshalJSON

func (i *AgeRestriction) UnmarshalJSON(data []byte) (err error)

type AutoFill

type AutoFill string

Method for the auto fill method of the API.

func (AutoFill) Instances

func (i AutoFill) Instances() []AutoFill

All instances of the AutoFill

func (*AutoFill) UnmarshalJSON

func (i *AutoFill) UnmarshalJSON(data []byte) (err error)

type Bool

type Bool string

A boolean value is expressed as a 0 for `false` and 1 for `true`. String is used as type as it's not possible to nil integer values (which is needed in order to omit unset parameters as the query parameter).

func (Bool) Instances

func (b Bool) Instances() []Bool

All instances of the Bool

func (*Bool) UnmarshalJSON

func (b *Bool) UnmarshalJSON(data []byte) (err error)

type ContentType

type ContentType string

Content type of media items.

func (ContentType) Instances

func (i ContentType) Instances() []ContentType

All instances of the ContentType

func (*ContentType) UnmarshalJSON

func (i *ContentType) UnmarshalJSON(data []byte) (err error)

type Dimension

type Dimension string

Geometric dimension of a media file.

func (Dimension) Instances

func (i Dimension) Instances() []Dimension

All instances of the Dimension

func (*Dimension) UnmarshalJSON

func (i *Dimension) UnmarshalJSON(data []byte) (err error)

type DistanceUnit

type DistanceUnit string

Metric or imperial distance units.

func (DistanceUnit) Instances

func (i DistanceUnit) Instances() []DistanceUnit

All instances of the DistanceUnit

func (*DistanceUnit) UnmarshalJSON

func (i *DistanceUnit) UnmarshalJSON(data []byte) (err error)

type Enum

type Enum[T ~string] interface {
	// A list of all possible values.
	Instances() []T
}

Used to simplify the usage of the enums in the cli and notification portion of the library.

type Gateway

type Gateway string

Used in conjunction with [QueryParameters.ForceGateway].

func (Gateway) Instances

func (i Gateway) Instances() []Gateway

All instances of the Gateway

func (*Gateway) UnmarshalJSON

func (i *Gateway) UnmarshalJSON(data []byte) (err error)

type ImageFormat

type ImageFormat string

Used to state the desired image format of a requested image.

func (ImageFormat) Instances

func (i ImageFormat) Instances() []ImageFormat

All instances of the ImageFormat

func (*ImageFormat) UnmarshalJSON

func (i *ImageFormat) UnmarshalJSON(data []byte) (err error)

type OrderDirection

type OrderDirection string

Direction of ordering elements.

func (OrderDirection) Instances

func (i OrderDirection) Instances() []OrderDirection

All instances of the OrderDirection

func (*OrderDirection) UnmarshalJSON

func (i *OrderDirection) UnmarshalJSON(data []byte) (err error)

type Orientation

type Orientation string

Media orientation.

func (Orientation) Instances

func (i Orientation) Instances() []Orientation

All instances of the Orientation

func (*Orientation) UnmarshalJSON

func (i *Orientation) UnmarshalJSON(data []byte) (err error)

type OutputModifier

type OutputModifier string

Output modifier used to define the detail level.

func (OutputModifier) Instances

func (i OutputModifier) Instances() []OutputModifier

All instances of the OutputModifier

func (*OutputModifier) UnmarshalJSON

func (i *OutputModifier) UnmarshalJSON(data []byte) (err error)

type QueryMode

type QueryMode string

Query modes.

func (QueryMode) Instances

func (i QueryMode) Instances() []QueryMode

All instances of the QueryMode

func (*QueryMode) UnmarshalJSON

func (i *QueryMode) UnmarshalJSON(data []byte) (err error)

type RichTextFormat

type RichTextFormat string

Possible rich text formats.

func (RichTextFormat) Instances

func (i RichTextFormat) Instances() []RichTextFormat

All instances of the RichTextFormat

func (*RichTextFormat) UnmarshalJSON

func (i *RichTextFormat) UnmarshalJSON(data []byte) (err error)

type StreamType

type StreamType string

Different streamtypes used in the API call.

func (StreamType) Instances

func (i StreamType) Instances() []StreamType

All instances of the StreamType

func (*StreamType) UnmarshalJSON

func (i *StreamType) UnmarshalJSON(data []byte) (err error)

type TemperatureUnit

type TemperatureUnit string

Metric or imperial temperature units.

func (TemperatureUnit) Instances

func (i TemperatureUnit) Instances() []TemperatureUnit

All instances of the TemperatureUnit

func (*TemperatureUnit) UnmarshalJSON

func (i *TemperatureUnit) UnmarshalJSON(data []byte) (err error)

Jump to

Keyboard shortcuts

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