gen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 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 ApplyScheduleJSONRequestBody

type ApplyScheduleJSONRequestBody = GenerateRequest

ApplyScheduleJSONRequestBody defines body for ApplySchedule for application/json ContentType.

type BlockItem

type BlockItem = BlockRecord

BlockItem defines model for BlockItem.

type BlockList

type BlockList = []BlockRecord

BlockList defines model for BlockList.

type BlockRecord

type BlockRecord struct {
	CreatedAt time.Time `json:"created_at"`
	Enabled   bool      `json:"enabled"`
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	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 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"`
}

GetScheduleParams defines parameters for GetSchedule.

type HistoryEntry

type HistoryEntry struct {
	BlockName   *string    `json:"block_name,omitempty"`
	ChannelId   *string    `json:"channel_id,omitempty"`
	ProgramId   *string    `json:"program_id,omitempty"`
	ScheduledAt *time.Time `json:"scheduled_at,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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

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

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 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 ScheduledSlot

type ScheduledSlot struct {
	Block     *BlockSpec                `json:"block,omitempty"`
	EndTime   *time.Time                `json:"end_time,omitempty"`
	Programs  *[]map[string]interface{} `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 {

	// (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)

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

	// (GET /channels)
	ListChannels(w http.ResponseWriter, r *http.Request)

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

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

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

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

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

	// (GET /status)
	GetStatus(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) 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) 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) ImportBlocks

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

ImportBlocks 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) ListSeriesState

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

ListSeriesState operation middleware

func (*ServerInterfaceWrapper) PatchSeriesState

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

PatchSeriesState 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"`
	TunarrError     *string `json:"tunarr_error,omitempty"`
	TunarrReachable bool    `json:"tunarr_reachable"`
	Version         string  `json:"version"`
}

Status defines model for Status.

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) 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) 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) ImportBlocks

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

(POST /blocks/import)

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) ListSeriesState

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

(GET /state/series)

func (Unimplemented) PatchSeriesState

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

(PATCH /state/series/{show_title})

func (Unimplemented) UpdateBlock

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

(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.

Jump to

Keyboard shortcuts

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