gen

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gen provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpec

func GetSpec() (swagger *openapi3.T, err error)

GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.

func GetSpecJSON

func GetSpecJSON() ([]byte, error)

GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.

func GetSwagger deprecated

func GetSwagger() (*openapi3.T, error)

GetSwagger returns the OpenAPI specification corresponding to the generated code in this file.

Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger to openapi3.T. Use GetSpec instead. This wrapper is retained for backwards compatibility.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ApplyRun added in v0.5.7

type ApplyRun struct {
	ChannelCount *int `json:"channel_count,omitempty"`
	Days         *int `json:"days,omitempty"`

	// Error The failure detail on a run whose status is "error"; "" otherwise.
	Error      *string    `json:"error,omitempty"`
	FinishedAt *time.Time `json:"finished_at,omitempty"`

	// Id The run's identifier, also stamped on the schedule_history rows it committed (HistoryEntry.run_id).
	Id string `json:"id"`

	// Scope The channel ID the apply was narrowed to, or "" for every channel.
	Scope     *string            `json:"scope,omitempty"`
	SlotCount *int               `json:"slot_count,omitempty"`
	Source    ApplyRunSource     `json:"source"`
	StartedAt time.Time          `json:"started_at"`
	Status    ApplyRunStatus     `json:"status"`
	Warnings  *[]ApplyRunWarning `json:"warnings,omitempty"`
}

ApplyRun One recorded apply. Written before the apply pushes anything to Tunarr and finalized afterwards, so a process that dies mid-apply still leaves an entry -- which is why status can read "running" on a row whose finished_at will never arrive.

type ApplyRunSource added in v0.5.7

type ApplyRunSource string

ApplyRunSource defines model for ApplyRun.Source.

const (
	Cli     ApplyRunSource = "cli"
	Cron    ApplyRunSource = "cron"
	Ui      ApplyRunSource = "ui"
	Unknown ApplyRunSource = "unknown"
)

Defines values for ApplyRunSource.

func (ApplyRunSource) Valid added in v0.5.7

func (e ApplyRunSource) Valid() bool

Valid indicates whether the value is a known member of the ApplyRunSource enum.

type ApplyRunStatus added in v0.5.7

type ApplyRunStatus string

ApplyRunStatus defines model for ApplyRun.Status.

const (
	Error   ApplyRunStatus = "error"
	Ok      ApplyRunStatus = "ok"
	Running ApplyRunStatus = "running"
)

Defines values for ApplyRunStatus.

func (ApplyRunStatus) Valid added in v0.5.7

func (e ApplyRunStatus) Valid() bool

Valid indicates whether the value is a known member of the ApplyRunStatus enum.

type ApplyRunWarning added in v0.5.7

type ApplyRunWarning struct {
	BlockName         *string    `json:"block_name,omitempty"`
	BlockingBlockName *string    `json:"blocking_block_name,omitempty"`
	ChannelId         *string    `json:"channel_id,omitempty"`
	DurationMinutes   *int       `json:"duration_minutes,omitempty"`
	OccurrenceStart   *time.Time `json:"occurrence_start,omitempty"`
}

ApplyRunWarning One occurrence this run planned a slot for and then dropped by conflict resolution -- the persisted form of Warning.

type ApplyScheduleJSONRequestBody

type ApplyScheduleJSONRequestBody = GenerateRequest

ApplyScheduleJSONRequestBody defines body for ApplySchedule for application/json ContentType.

type BlockDuplicate added in v0.5.10

type BlockDuplicate struct {
	Name string `json:"name"`
}

BlockDuplicate The name for the copy. Required, and never defaulted server-side: a collision belongs to the caller, who is the one who can see what the other block is.

type BlockItem

type BlockItem = BlockRecord

BlockItem defines model for BlockItem.

type BlockList

type BlockList = []BlockRecord

BlockList defines model for BlockList.

type BlockPatch added in v0.5.8

type BlockPatch struct {
	// DisabledUntil Take the block dark until this instant, after which it returns on its own. An explicit `null` CLEARS the dark window and is deliberately distinct from an absent key, which leaves it alone -- clearing is the only way an operator brings a block back early, and the two cases would be indistinguishable otherwise.
	DisabledUntil *time.Time `json:"disabled_until,omitempty"`
	Enabled       *bool      `json:"enabled,omitempty"`
}

BlockPatch Field-scoped block update. Absent fields are left unchanged; a body with no fields set is rejected.

type BlockRecord

type BlockRecord struct {
	CreatedAt time.Time `json:"created_at"`

	// DisabledUntil The instant this block returns to the schedule. Absent when there is no dark window. Independent of `enabled`: a block is planned only when it is enabled AND not currently dark. A value in the past is stale rather than meaningful -- it no longer suppresses anything.
	DisabledUntil *time.Time `json:"disabled_until,omitempty"`
	Enabled       bool       `json:"enabled"`
	Id            string     `json:"id"`
	Name          string     `json:"name"`

	// NextOccurrence The next instant this block will actually air, honouring both `enabled` and `disabled_until`. Absent when the block is disabled, when its cron expression never fires, or when the expression will not parse. For a dark block this is the first occurrence at or after it wakes, not the next raw cron tick -- a NEXT reading beside a dark block would otherwise be a lie.
	NextOccurrence *time.Time `json:"next_occurrence,omitempty"`
	Spec           BlockSpec  `json:"spec"`
	UpdatedAt      time.Time  `json:"updated_at"`
}

BlockRecord defines model for BlockRecord.

type BlockSpec

type BlockSpec struct {
	ChannelId                  string          `json:"channel_id"`
	Cron                       string          `json:"cron"`
	Duration                   int             `json:"duration"`
	Fallback                   *SeriesFallback `json:"fallback,omitempty"`
	Filler                     *FillerConfig   `json:"filler,omitempty"`
	Filter                     *Filter         `json:"filter,omitempty"`
	MaxDurationOverflowMinutes *int            `json:"max_duration_overflow_minutes,omitempty"`
	Name                       string          `json:"name"`
	Priority                   *int            `json:"priority,omitempty"`
	Series                     *[]SeriesConfig `json:"series,omitempty"`
	Type                       *BlockSpecType  `json:"type,omitempty"`
}

BlockSpec defines model for BlockSpec.

type BlockSpecType

type BlockSpecType string

BlockSpecType defines model for BlockSpec.Type.

const (
	BlockSpecTypeFilter BlockSpecType = "filter"
	BlockSpecTypeSeries BlockSpecType = "series"
)

Defines values for BlockSpecType.

func (BlockSpecType) Valid

func (e BlockSpecType) Valid() bool

Valid indicates whether the value is a known member of the BlockSpecType enum.

type BlockWrite

type BlockWrite struct {
	Enabled *bool     `json:"enabled,omitempty"`
	Spec    BlockSpec `json:"spec"`
}

BlockWrite defines model for BlockWrite.

type Channel

type Channel struct {
	Id     *string `json:"id,omitempty"`
	Name   *string `json:"name,omitempty"`
	Number *int    `json:"number,omitempty"`
}

Channel defines model for Channel.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type CreateBlockJSONRequestBody

type CreateBlockJSONRequestBody = BlockWrite

CreateBlockJSONRequestBody defines body for CreateBlock for application/json ContentType.

type DeleteHistoryRangeParams added in v0.5.12

type DeleteHistoryRangeParams struct {
	// Before Delete everything scheduled before this instant. Mutually exclusive with from/to.
	Before    *time.Time `form:"before,omitempty" json:"before,omitempty"`
	From      *time.Time `form:"from,omitempty" json:"from,omitempty"`
	To        *time.Time `form:"to,omitempty" json:"to,omitempty"`
	ChannelId *string    `form:"channel_id,omitempty" json:"channel_id,omitempty"`
	BlockName *string    `form:"block_name,omitempty" json:"block_name,omitempty"`
	ShowTitle *string    `form:"show_title,omitempty" json:"show_title,omitempty"`
	DryRun    *bool      `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

DeleteHistoryRangeParams defines parameters for DeleteHistoryRange.

type DuplicateBlockJSONRequestBody added in v0.5.10

type DuplicateBlockJSONRequestBody = BlockDuplicate

DuplicateBlockJSONRequestBody defines body for DuplicateBlock for application/json ContentType.

type FillerConfig

type FillerConfig struct {
	Enabled       *bool   `json:"enabled,omitempty"`
	FillerListId  *string `json:"filler_list_id,omitempty"`
	MaxFillerTime *int    `json:"max_filler_time,omitempty"`
	MinGapTime    *int    `json:"min_gap_time,omitempty"`
}

FillerConfig defines model for FillerConfig.

type Filter

type Filter struct {
	Genres       *[]string `json:"genres,omitempty"`
	MaxDuration  *int      `json:"max_duration,omitempty"`
	MinDuration  *int      `json:"min_duration,omitempty"`
	Ratings      *[]string `json:"ratings,omitempty"`
	Tags         *[]string `json:"tags,omitempty"`
	TitlePattern *string   `json:"title_pattern,omitempty"`
	YearFrom     *int      `json:"year_from,omitempty"`
	YearTo       *int      `json:"year_to,omitempty"`
}

Filter defines model for Filter.

type GenerateRequest

type GenerateRequest struct {
	ChannelId *string `json:"channel_id,omitempty"`
	Days      *int    `json:"days,omitempty"`
}

GenerateRequest defines model for GenerateRequest.

type GenerateScheduleJSONRequestBody

type GenerateScheduleJSONRequestBody = GenerateRequest

GenerateScheduleJSONRequestBody defines body for GenerateSchedule for application/json ContentType.

type GetHistoryParams

type GetHistoryParams struct {
	Days *int `form:"days,omitempty" json:"days,omitempty"`
}

GetHistoryParams defines parameters for GetHistory.

type GetScheduleParams

type GetScheduleParams struct {
	Days *int `form:"days,omitempty" json:"days,omitempty"`

	// ChannelId Restrict planning to this channel (parity with GenerateRequest.channel_id) -- when set, only blocks targeting this channel are planned at all. Omitted means every channel.
	ChannelId *string `form:"channel_id,omitempty" json:"channel_id,omitempty"`
}

GetScheduleParams defines parameters for GetSchedule.

type HistoryEntry

type HistoryEntry struct {
	BlockName  *string  `json:"block_name,omitempty"`
	ChannelId  *string  `json:"channel_id,omitempty"`
	DurationMs *float64 `json:"duration_ms,omitempty"`

	// OccurrenceStart The block occurrence's own cron-computed start time -- the identity half of the (block_name, occurrence_start) key.
	OccurrenceStart *time.Time `json:"occurrence_start,omitempty"`
	ProgramId       *string    `json:"program_id,omitempty"`

	// RunId The apply run that committed this row, or "" for rows written before runs were recorded. Runs are not backfilled.
	RunId *string `json:"run_id,omitempty"`

	// ScheduledAt The wall-clock instant planning happened -- the value the days window is measured against, not the occurrence's own start time (that is occurrence_start).
	ScheduledAt *time.Time `json:"scheduled_at,omitempty"`

	// Sequence Playback order within the occurrence.
	Sequence *int `json:"sequence,omitempty"`

	// Title The programme's title. Stored since the enrichment migration, exposed since v0.5.7.
	Title *string `json:"title,omitempty"`

	// Type The Tunarr program type (e.g. episode, movie).
	Type *string `json:"type,omitempty"`
}

HistoryEntry defines model for HistoryEntry.

type ImportBlocksParams

type ImportBlocksParams struct {
	DryRun *bool `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

ImportBlocksParams defines parameters for ImportBlocks.

type ImportResult

type ImportResult struct {
	DryRun   bool      `json:"dry_run"`
	Imported int       `json:"imported"`
	Names    *[]string `json:"names,omitempty"`
}

ImportResult defines model for ImportResult.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type ListApplyRunsParams added in v0.5.7

type ListApplyRunsParams struct {
	Days  *int `form:"days,omitempty" json:"days,omitempty"`
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}

ListApplyRunsParams defines parameters for ListApplyRuns.

type MediaMeta added in v0.2.0

type MediaMeta struct {
	Genres  []string `json:"genres"`
	Ratings []string `json:"ratings"`
}

MediaMeta defines model for MediaMeta.

type MediaShow added in v0.2.0

type MediaShow struct {
	EpisodeCount int    `json:"episode_count"`
	Title        string `json:"title"`
}

MediaShow defines model for MediaShow.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NextCronOccurrencesParams added in v0.5.10

type NextCronOccurrencesParams struct {
	// Expr A standard 5-field cron expression, or a descriptor such as `@daily`.
	Expr  string `form:"expr" json:"expr"`
	Count *int   `form:"count,omitempty" json:"count,omitempty"`

	// From RFC3339 instant to search after. Defaults to now.
	From *time.Time `form:"from,omitempty" json:"from,omitempty"`
}

NextCronOccurrencesParams defines parameters for NextCronOccurrences.

type PatchBlockJSONRequestBody added in v0.5.8

type PatchBlockJSONRequestBody = BlockPatch

PatchBlockJSONRequestBody defines body for PatchBlock for application/json ContentType.

type PatchSeriesStateJSONRequestBody

type PatchSeriesStateJSONRequestBody = SeriesStatePatch

PatchSeriesStateJSONRequestBody defines body for PatchSeriesState for application/json ContentType.

type PlanResult

type PlanResult struct {
	Applied  bool                       `json:"applied"`
	Channels map[string][]ScheduledSlot `json:"channels"`
	Warnings *[]Warning                 `json:"warnings,omitempty"`
}

PlanResult defines model for PlanResult.

type Problem

type Problem struct {
	Detail    *string `json:"detail,omitempty"`
	RequestId *string `json:"request_id,omitempty"`
	Status    int     `json:"status"`
	Title     string  `json:"title"`
	Type      string  `json:"type"`
}

Problem defines model for Problem.

type RemovalReport added in v0.5.12

type RemovalReport struct {
	Airings int   `json:"airings"`
	DryRun  *bool `json:"dry_run,omitempty"`

	// EmptiedSlots Occurrences left with no airings. Each keeps a marker saying it was committed and produced nothing, so a later apply does not re-plan a slot that already went out.
	EmptiedSlots int `json:"emptied_slots"`

	// SeriesStates Cursors removed. Always 0 for a range deletion.
	SeriesStates *int `json:"series_states,omitempty"`

	// Snapshots Occurrence snapshots a key was scrubbed from. Always 0 for a range deletion.
	Snapshots *int `json:"snapshots,omitempty"`
}

RemovalReport What a removal touched, per table. On a dry run, what it would touch.

type RemoveSeriesStateParams added in v0.5.12

type RemoveSeriesStateParams struct {
	// DryRun Report what would be removed without removing it.
	DryRun *bool `form:"dry_run,omitempty" json:"dry_run,omitempty"`
}

RemoveSeriesStateParams defines parameters for RemoveSeriesState.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ScheduledProgram added in v0.5.1

type ScheduledProgram struct {
	DurationMs int64 `json:"duration_ms"`

	// Episode Episode number; omitted for non-episodes.
	Episode *int `json:"episode,omitempty"`

	// Season Season number; omitted for non-episodes.
	Season *int `json:"season,omitempty"`

	// StartTime This program's own computed air time -- the slot's start plus the durations of every program before it in the lineup.
	StartTime time.Time `json:"start_time"`
	Title     string    `json:"title"`

	// Type Program kind as Tunarr reports it (movie, episode, flex, ...). Omitted when the source program carries no type.
	Type *string `json:"type,omitempty"`
}

ScheduledProgram One planned program inside a slot's lineup, in airing order. A typed projection of the internal Tunarr program (the old additionalProperties passthrough is gone -- hard swap, pre-v1.0): exactly what a guide needs to render a rundown, nothing else.

type ScheduledSlot

type ScheduledSlot struct {
	Block     *BlockSpec          `json:"block,omitempty"`
	EndTime   *time.Time          `json:"end_time,omitempty"`
	Programs  *[]ScheduledProgram `json:"programs,omitempty"`
	StartTime *time.Time          `json:"start_time,omitempty"`
}

ScheduledSlot defines model for ScheduledSlot.

type SeriesConfig

type SeriesConfig struct {
	EpisodesPerBlock int                     `json:"episodes_per_block"`
	MaxRuns          *int                    `json:"max_runs,omitempty"`
	OnComplete       *SeriesConfigOnComplete `json:"on_complete,omitempty"`
	ShowTitle        string                  `json:"show_title"`
	SkipEpisodes     *[]string               `json:"skip_episodes,omitempty"`
	StartEpisode     *int                    `json:"start_episode,omitempty"`
	StartSeason      *int                    `json:"start_season,omitempty"`
}

SeriesConfig defines model for SeriesConfig.

type SeriesConfigOnComplete

type SeriesConfigOnComplete string

SeriesConfigOnComplete defines model for SeriesConfig.OnComplete.

const (
	Continue SeriesConfigOnComplete = "continue"
	Disable  SeriesConfigOnComplete = "disable"
	Restart  SeriesConfigOnComplete = "restart"
)

Defines values for SeriesConfigOnComplete.

func (SeriesConfigOnComplete) Valid

func (e SeriesConfigOnComplete) Valid() bool

Valid indicates whether the value is a known member of the SeriesConfigOnComplete enum.

type SeriesFallback

type SeriesFallback struct {
	FillerFilter *Filter             `json:"filler_filter,omitempty"`
	Mode         *SeriesFallbackMode `json:"mode,omitempty"`
}

SeriesFallback defines model for SeriesFallback.

type SeriesFallbackMode

type SeriesFallbackMode string

SeriesFallbackMode defines model for SeriesFallback.Mode.

const (
	Filler       SeriesFallbackMode = "filler"
	Redistribute SeriesFallbackMode = "redistribute"
)

Defines values for SeriesFallbackMode.

func (SeriesFallbackMode) Valid

func (e SeriesFallbackMode) Valid() bool

Valid indicates whether the value is a known member of the SeriesFallbackMode enum.

type SeriesState

type SeriesState struct {
	Completed      *bool      `json:"completed,omitempty"`
	CurrentEpisode int        `json:"current_episode"`
	CurrentSeason  int        `json:"current_season"`
	Disabled       *bool      `json:"disabled,omitempty"`
	LastAired      *time.Time `json:"last_aired,omitempty"`
	RunCount       *int       `json:"run_count,omitempty"`
	ShowTitle      string     `json:"show_title"`
}

SeriesState defines model for SeriesState.

type SeriesStatePatch

type SeriesStatePatch struct {
	Completed      *bool `json:"completed,omitempty"`
	CurrentEpisode *int  `json:"current_episode,omitempty"`
	CurrentSeason  *int  `json:"current_season,omitempty"`
	Disabled       *bool `json:"disabled,omitempty"`
}

SeriesStatePatch defines model for SeriesStatePatch.

type ServerInterface

type ServerInterface interface {

	// (GET /applies)
	ListApplyRuns(w http.ResponseWriter, r *http.Request, params ListApplyRunsParams)

	// (POST /apply)
	ApplySchedule(w http.ResponseWriter, r *http.Request)

	// (GET /blocks)
	ListBlocks(w http.ResponseWriter, r *http.Request)

	// (POST /blocks)
	CreateBlock(w http.ResponseWriter, r *http.Request)

	// (GET /blocks/export)
	ExportBlocks(w http.ResponseWriter, r *http.Request)

	// (POST /blocks/import)
	ImportBlocks(w http.ResponseWriter, r *http.Request, params ImportBlocksParams)

	// (DELETE /blocks/{id})
	DeleteBlock(w http.ResponseWriter, r *http.Request, id string)

	// (GET /blocks/{id})
	GetBlock(w http.ResponseWriter, r *http.Request, id string)

	// (PATCH /blocks/{id})
	PatchBlock(w http.ResponseWriter, r *http.Request, id string)

	// (PUT /blocks/{id})
	UpdateBlock(w http.ResponseWriter, r *http.Request, id string, params UpdateBlockParams)
	// DuplicateBlock Copy a block into a new, disabled one
	// (POST /blocks/{id}/duplicate)
	DuplicateBlock(w http.ResponseWriter, r *http.Request, id string)

	// (GET /channels)
	ListChannels(w http.ResponseWriter, r *http.Request)
	// NextCronOccurrences Upcoming occurrences of a cron expression
	// (GET /cron/next)
	NextCronOccurrences(w http.ResponseWriter, r *http.Request, params NextCronOccurrencesParams)
	// StreamEvents Server-sent event stream of live changes
	// (GET /events)
	StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)

	// (POST /generate)
	GenerateSchedule(w http.ResponseWriter, r *http.Request)

	// (DELETE /history)
	DeleteHistoryRange(w http.ResponseWriter, r *http.Request, params DeleteHistoryRangeParams)

	// (GET /history)
	GetHistory(w http.ResponseWriter, r *http.Request, params GetHistoryParams)

	// (GET /media/meta)
	GetMediaMeta(w http.ResponseWriter, r *http.Request)

	// (GET /media/shows)
	ListMediaShows(w http.ResponseWriter, r *http.Request)

	// (GET /schedule)
	GetSchedule(w http.ResponseWriter, r *http.Request, params GetScheduleParams)

	// (GET /state/series)
	ListSeriesState(w http.ResponseWriter, r *http.Request)

	// (DELETE /state/series/{show_title})
	RemoveSeriesState(w http.ResponseWriter, r *http.Request, showTitle string, params RemoveSeriesStateParams)

	// (PATCH /state/series/{show_title})
	PatchSeriesState(w http.ResponseWriter, r *http.Request, showTitle string)

	// (GET /status)
	GetStatus(w http.ResponseWriter, r *http.Request)

	// (GET /storage)
	GetStorage(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) ApplySchedule

func (siw *ServerInterfaceWrapper) ApplySchedule(w http.ResponseWriter, r *http.Request)

ApplySchedule operation middleware

func (*ServerInterfaceWrapper) CreateBlock

func (siw *ServerInterfaceWrapper) CreateBlock(w http.ResponseWriter, r *http.Request)

CreateBlock operation middleware

func (*ServerInterfaceWrapper) DeleteBlock

func (siw *ServerInterfaceWrapper) DeleteBlock(w http.ResponseWriter, r *http.Request)

DeleteBlock operation middleware

func (*ServerInterfaceWrapper) DeleteHistoryRange added in v0.5.12

func (siw *ServerInterfaceWrapper) DeleteHistoryRange(w http.ResponseWriter, r *http.Request)

DeleteHistoryRange operation middleware

func (*ServerInterfaceWrapper) DuplicateBlock added in v0.5.10

func (siw *ServerInterfaceWrapper) DuplicateBlock(w http.ResponseWriter, r *http.Request)

DuplicateBlock operation middleware

func (*ServerInterfaceWrapper) ExportBlocks

func (siw *ServerInterfaceWrapper) ExportBlocks(w http.ResponseWriter, r *http.Request)

ExportBlocks operation middleware

func (*ServerInterfaceWrapper) GenerateSchedule

func (siw *ServerInterfaceWrapper) GenerateSchedule(w http.ResponseWriter, r *http.Request)

GenerateSchedule operation middleware

func (*ServerInterfaceWrapper) GetBlock

func (siw *ServerInterfaceWrapper) GetBlock(w http.ResponseWriter, r *http.Request)

GetBlock operation middleware

func (*ServerInterfaceWrapper) GetHistory

func (siw *ServerInterfaceWrapper) GetHistory(w http.ResponseWriter, r *http.Request)

GetHistory operation middleware

func (*ServerInterfaceWrapper) GetMediaMeta added in v0.2.0

func (siw *ServerInterfaceWrapper) GetMediaMeta(w http.ResponseWriter, r *http.Request)

GetMediaMeta operation middleware

func (*ServerInterfaceWrapper) GetSchedule

func (siw *ServerInterfaceWrapper) GetSchedule(w http.ResponseWriter, r *http.Request)

GetSchedule operation middleware

func (*ServerInterfaceWrapper) GetStatus

func (siw *ServerInterfaceWrapper) GetStatus(w http.ResponseWriter, r *http.Request)

GetStatus operation middleware

func (*ServerInterfaceWrapper) GetStorage added in v0.5.12

func (siw *ServerInterfaceWrapper) GetStorage(w http.ResponseWriter, r *http.Request)

GetStorage operation middleware

func (*ServerInterfaceWrapper) ImportBlocks

func (siw *ServerInterfaceWrapper) ImportBlocks(w http.ResponseWriter, r *http.Request)

ImportBlocks operation middleware

func (*ServerInterfaceWrapper) ListApplyRuns added in v0.5.7

func (siw *ServerInterfaceWrapper) ListApplyRuns(w http.ResponseWriter, r *http.Request)

ListApplyRuns operation middleware

func (*ServerInterfaceWrapper) ListBlocks

func (siw *ServerInterfaceWrapper) ListBlocks(w http.ResponseWriter, r *http.Request)

ListBlocks operation middleware

func (*ServerInterfaceWrapper) ListChannels

func (siw *ServerInterfaceWrapper) ListChannels(w http.ResponseWriter, r *http.Request)

ListChannels operation middleware

func (*ServerInterfaceWrapper) ListMediaShows added in v0.2.0

func (siw *ServerInterfaceWrapper) ListMediaShows(w http.ResponseWriter, r *http.Request)

ListMediaShows operation middleware

func (*ServerInterfaceWrapper) ListSeriesState

func (siw *ServerInterfaceWrapper) ListSeriesState(w http.ResponseWriter, r *http.Request)

ListSeriesState operation middleware

func (*ServerInterfaceWrapper) NextCronOccurrences added in v0.5.10

func (siw *ServerInterfaceWrapper) NextCronOccurrences(w http.ResponseWriter, r *http.Request)

NextCronOccurrences operation middleware

func (*ServerInterfaceWrapper) PatchBlock added in v0.5.8

func (siw *ServerInterfaceWrapper) PatchBlock(w http.ResponseWriter, r *http.Request)

PatchBlock operation middleware

func (*ServerInterfaceWrapper) PatchSeriesState

func (siw *ServerInterfaceWrapper) PatchSeriesState(w http.ResponseWriter, r *http.Request)

PatchSeriesState operation middleware

func (*ServerInterfaceWrapper) RemoveSeriesState added in v0.5.12

func (siw *ServerInterfaceWrapper) RemoveSeriesState(w http.ResponseWriter, r *http.Request)

RemoveSeriesState operation middleware

func (*ServerInterfaceWrapper) StreamEvents added in v0.5.8

func (siw *ServerInterfaceWrapper) StreamEvents(w http.ResponseWriter, r *http.Request)

StreamEvents operation middleware

func (*ServerInterfaceWrapper) UpdateBlock

func (siw *ServerInterfaceWrapper) UpdateBlock(w http.ResponseWriter, r *http.Request)

UpdateBlock operation middleware

type Status

type Status struct {
	Blocks *int `json:"blocks,omitempty"`

	// LastAppliedAt When the most recent apply pushed at least one lineup to Tunarr (planned pushes and stale-channel clears alike), sampled at push time. Omitted when no apply has been recorded yet.
	LastAppliedAt *time.Time `json:"last_applied_at,omitempty"`

	// NextCronTick When the serve command's cron loop will next generate and apply a schedule. Omitted when no cron loop is running (or before its first tick has been scheduled).
	NextCronTick    *time.Time `json:"next_cron_tick,omitempty"`
	TunarrError     *string    `json:"tunarr_error,omitempty"`
	TunarrReachable bool       `json:"tunarr_reachable"`
	Version         string     `json:"version"`
}

Status defines model for Status.

type StorageReport added in v0.5.12

type StorageReport struct {
	Airings      int        `json:"airings"`
	ApplyRuns    int        `json:"apply_runs"`
	NewestAiring *time.Time `json:"newest_airing,omitempty"`
	OldestAiring *time.Time `json:"oldest_airing,omitempty"`

	// Sentinels Committed-but-empty occurrence markers. Counted apart from airings because they cannot be deleted by range.
	Sentinels    int `json:"sentinels"`
	SeriesStates int `json:"series_states"`
	Snapshots    int `json:"snapshots"`
	Warnings     int `json:"warnings"`
}

StorageReport defines model for StorageReport.

type StreamEventsParams added in v0.5.8

type StreamEventsParams struct {
	// LastEventID The id of the last event this client processed.
	LastEventID *string `json:"Last-Event-ID,omitempty"`
}

StreamEventsParams defines parameters for StreamEvents.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) ApplySchedule

func (_ Unimplemented) ApplySchedule(w http.ResponseWriter, r *http.Request)

(POST /apply)

func (Unimplemented) CreateBlock

func (_ Unimplemented) CreateBlock(w http.ResponseWriter, r *http.Request)

(POST /blocks)

func (Unimplemented) DeleteBlock

func (_ Unimplemented) DeleteBlock(w http.ResponseWriter, r *http.Request, id string)

(DELETE /blocks/{id})

func (Unimplemented) DeleteHistoryRange added in v0.5.12

func (_ Unimplemented) DeleteHistoryRange(w http.ResponseWriter, r *http.Request, params DeleteHistoryRangeParams)

(DELETE /history)

func (Unimplemented) DuplicateBlock added in v0.5.10

func (_ Unimplemented) DuplicateBlock(w http.ResponseWriter, r *http.Request, id string)

DuplicateBlock Copy a block into a new, disabled one (POST /blocks/{id}/duplicate)

func (Unimplemented) ExportBlocks

func (_ Unimplemented) ExportBlocks(w http.ResponseWriter, r *http.Request)

(GET /blocks/export)

func (Unimplemented) GenerateSchedule

func (_ Unimplemented) GenerateSchedule(w http.ResponseWriter, r *http.Request)

(POST /generate)

func (Unimplemented) GetBlock

func (_ Unimplemented) GetBlock(w http.ResponseWriter, r *http.Request, id string)

(GET /blocks/{id})

func (Unimplemented) GetHistory

func (_ Unimplemented) GetHistory(w http.ResponseWriter, r *http.Request, params GetHistoryParams)

(GET /history)

func (Unimplemented) GetMediaMeta added in v0.2.0

func (_ Unimplemented) GetMediaMeta(w http.ResponseWriter, r *http.Request)

(GET /media/meta)

func (Unimplemented) GetSchedule

func (_ Unimplemented) GetSchedule(w http.ResponseWriter, r *http.Request, params GetScheduleParams)

(GET /schedule)

func (Unimplemented) GetStatus

func (_ Unimplemented) GetStatus(w http.ResponseWriter, r *http.Request)

(GET /status)

func (Unimplemented) GetStorage added in v0.5.12

func (_ Unimplemented) GetStorage(w http.ResponseWriter, r *http.Request)

(GET /storage)

func (Unimplemented) ImportBlocks

func (_ Unimplemented) ImportBlocks(w http.ResponseWriter, r *http.Request, params ImportBlocksParams)

(POST /blocks/import)

func (Unimplemented) ListApplyRuns added in v0.5.7

func (_ Unimplemented) ListApplyRuns(w http.ResponseWriter, r *http.Request, params ListApplyRunsParams)

(GET /applies)

func (Unimplemented) ListBlocks

func (_ Unimplemented) ListBlocks(w http.ResponseWriter, r *http.Request)

(GET /blocks)

func (Unimplemented) ListChannels

func (_ Unimplemented) ListChannels(w http.ResponseWriter, r *http.Request)

(GET /channels)

func (Unimplemented) ListMediaShows added in v0.2.0

func (_ Unimplemented) ListMediaShows(w http.ResponseWriter, r *http.Request)

(GET /media/shows)

func (Unimplemented) ListSeriesState

func (_ Unimplemented) ListSeriesState(w http.ResponseWriter, r *http.Request)

(GET /state/series)

func (Unimplemented) NextCronOccurrences added in v0.5.10

func (_ Unimplemented) NextCronOccurrences(w http.ResponseWriter, r *http.Request, params NextCronOccurrencesParams)

NextCronOccurrences Upcoming occurrences of a cron expression (GET /cron/next)

func (Unimplemented) PatchBlock added in v0.5.8

func (_ Unimplemented) PatchBlock(w http.ResponseWriter, r *http.Request, id string)

(PATCH /blocks/{id})

func (Unimplemented) PatchSeriesState

func (_ Unimplemented) PatchSeriesState(w http.ResponseWriter, r *http.Request, showTitle string)

(PATCH /state/series/{show_title})

func (Unimplemented) RemoveSeriesState added in v0.5.12

func (_ Unimplemented) RemoveSeriesState(w http.ResponseWriter, r *http.Request, showTitle string, params RemoveSeriesStateParams)

(DELETE /state/series/{show_title})

func (Unimplemented) StreamEvents added in v0.5.8

func (_ Unimplemented) StreamEvents(w http.ResponseWriter, r *http.Request, params StreamEventsParams)

StreamEvents Server-sent event stream of live changes (GET /events)

func (Unimplemented) UpdateBlock

func (_ Unimplemented) UpdateBlock(w http.ResponseWriter, r *http.Request, id string, params UpdateBlockParams)

(PUT /blocks/{id})

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdateBlockJSONRequestBody

type UpdateBlockJSONRequestBody = BlockWrite

UpdateBlockJSONRequestBody defines body for UpdateBlock for application/json ContentType.

type UpdateBlockParams added in v0.5.8

type UpdateBlockParams struct {
	// IfMatch The block's current `updated_at`, as returned by GET, optionally quoted. A mismatch means someone else saved since this client last read, and the write is refused rather than discarding their edit.
	IfMatch string `json:"If-Match"`
}

UpdateBlockParams defines parameters for UpdateBlock.

type Warning added in v0.2.2

type Warning struct {
	// BlockName The block whose occurrence was dropped.
	BlockName *string `json:"block_name,omitempty"`

	// BlockingBlockName The block whose occurrence it lost to.
	BlockingBlockName *string `json:"blocking_block_name,omitempty"`

	// ChannelId The channel both occurrences contended for.
	ChannelId *string `json:"channel_id,omitempty"`

	// DurationMinutes How long the dropped occurrence would have run.
	DurationMinutes *int `json:"duration_minutes,omitempty"`

	// OccurrenceStart That occurrence's cron-computed start time.
	OccurrenceStart *time.Time `json:"occurrence_start,omitempty"`
}

Warning One occurrence that was planned a time slot but then dropped by conflict resolution -- an overlapping occurrence on the same channel, resolved by priority (higher wins; equal priority is first-come). Previously this was only visible in a server-side INFO log line.

Jump to

Keyboard shortcuts

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