controllers

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CSRFCookieName added in v0.7.0

func CSRFCookieName() string

func PrincipalFromContext added in v0.7.0

func PrincipalFromContext(c *echo.Context) (*auth.Principal, bool)

func SessionCookieName added in v0.7.0

func SessionCookieName() string

func SetPrincipal added in v0.7.0

func SetPrincipal(c *echo.Context, principal *auth.Principal)

Types

type ActiveItemStats added in v0.6.0

type ActiveItemStats struct {
	ID        string           `json:"id"`
	ReleaseID string           `json:"release_id"`
	Title     string           `json:"title"`
	Status    domain.JobStatus `json:"status"`
	Size      int64            `json:"size"`
	Bytes     int64            `json:"bytes"`
}

type AggregatorController added in v0.6.0

type AggregatorController struct {
	Service aggregatorService
}

func NewAggregatorController added in v0.6.0

func NewAggregatorController(module app.AggregatorModule) *AggregatorController

func (*AggregatorController) SearchReleases added in v0.6.0

func (ctrl *AggregatorController) SearchReleases(c *echo.Context) error

type Attr

type Attr struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

type AuthController added in v0.7.0

type AuthController struct {
	Service *auth.Service
}

func (*AuthController) CreateCurrentUserToken added in v0.7.0

func (ctrl *AuthController) CreateCurrentUserToken(c *echo.Context) error

func (*AuthController) CreateInitialUser added in v0.7.0

func (ctrl *AuthController) CreateInitialUser(c *echo.Context) error

func (*AuthController) CreateSession added in v0.7.0

func (ctrl *AuthController) CreateSession(c *echo.Context) error

func (*AuthController) CreateToken added in v0.7.0

func (ctrl *AuthController) CreateToken(c *echo.Context) error

func (*AuthController) DeleteRole added in v0.7.0

func (ctrl *AuthController) DeleteRole(c *echo.Context) error

func (*AuthController) DeleteSession added in v0.7.0

func (ctrl *AuthController) DeleteSession(c *echo.Context) error

func (*AuthController) DeleteUser added in v0.7.0

func (ctrl *AuthController) DeleteUser(c *echo.Context) error

func (*AuthController) GetSession added in v0.7.0

func (ctrl *AuthController) GetSession(c *echo.Context) error

func (*AuthController) GetSetupStatus added in v0.7.0

func (ctrl *AuthController) GetSetupStatus(c *echo.Context) error

func (*AuthController) GetUser added in v0.7.0

func (ctrl *AuthController) GetUser(c *echo.Context) error

func (*AuthController) ListCurrentUserTokens added in v0.7.0

func (ctrl *AuthController) ListCurrentUserTokens(c *echo.Context) error

func (*AuthController) ListRoles added in v0.7.0

func (ctrl *AuthController) ListRoles(c *echo.Context) error

func (*AuthController) ListTokens added in v0.7.0

func (ctrl *AuthController) ListTokens(c *echo.Context) error

func (*AuthController) ListUsers added in v0.7.0

func (ctrl *AuthController) ListUsers(c *echo.Context) error

func (*AuthController) RevokeCurrentUserToken added in v0.7.0

func (ctrl *AuthController) RevokeCurrentUserToken(c *echo.Context) error

func (*AuthController) RevokeToken added in v0.7.0

func (ctrl *AuthController) RevokeToken(c *echo.Context) error

func (*AuthController) UpsertRole added in v0.7.0

func (ctrl *AuthController) UpsertRole(c *echo.Context) error

func (*AuthController) UpsertUser added in v0.7.0

func (ctrl *AuthController) UpsertUser(c *echo.Context) error

type CapCategory

type CapCategory struct {
	ID      int         `xml:"id,attr"`
	Name    string      `xml:"name,attr"`
	SubCats []CapSubCat `xml:"subcat"`
}

type CapGenre added in v0.6.0

type CapGenre struct {
	ID   int    `xml:"id,attr,omitempty"`
	Name string `xml:"name,attr"`
}

type CapGroup added in v0.6.0

type CapGroup struct {
	Name string `xml:"name,attr"`
}

type CapSubCat

type CapSubCat struct {
	ID          int    `xml:"id,attr"`
	Name        string `xml:"name,attr"`
	Description string `xml:"description,attr,omitempty"`
}

type Channel

type Channel struct {
	Title       string    `xml:"title"`
	Description string    `xml:"description"`
	Link        string    `xml:"link"`
	Items       []RSSItem `xml:"item"`
	Response    Response  `xml:"newznab:response"`
}

type CompatAPIController added in v0.6.0

type CompatAPIController struct {
	SABEnabled     bool
	NewznabEnabled bool

	SAB     *SABController
	Newznab *NewznabController
}
compatibility multiplexer for shared `/api` transport.

Dispatches by query intent: - `mode=...` => SAB-compatible downloader API - `t=...` => Newznab-compatible aggregator API

func (*CompatAPIController) Handle added in v0.6.0

func (ctrl *CompatAPIController) Handle(c *echo.Context) error

type DownloadEvent added in v0.6.0

type DownloadEvent struct {
	Service downloadEventService
}

Event message structure for UI

func NewDownloadEvent added in v0.6.0

func NewDownloadEvent(queries app.DownloaderQueries) *DownloadEvent

func (*DownloadEvent) HandleEvents added in v0.6.0

func (ctrl *DownloadEvent) HandleEvents(c *echo.Context) error

type Enclosure

type Enclosure struct {
	URL    string `xml:"url,attr"`
	Length int64  `xml:"length,attr"`
	Type   string `xml:"type,attr"`
}

type EventStats added in v0.6.0

type EventStats struct {
	Bps        int64            `json:"bps"`
	Progress   float64          `json:"progress"`
	ActiveJobs int              `json:"active_jobs"`
	ActiveItem *ActiveItemStats `json:"active_item,omitempty"`
}

type IndexerAdminController added in v0.7.0

type IndexerAdminController struct {
	Service indexerService
}

func NewIndexerAdminController added in v0.7.0

func NewIndexerAdminController(service indexerService) *IndexerAdminController

func (*IndexerAdminController) DryRunMaintenanceTask added in v0.8.0

func (ctrl *IndexerAdminController) DryRunMaintenanceTask(c *echo.Context) error

func (*IndexerAdminController) GetBackfillProgress added in v0.7.2

func (ctrl *IndexerAdminController) GetBackfillProgress(c *echo.Context) error

func (*IndexerAdminController) GetDashboardStats added in v0.7.2

func (ctrl *IndexerAdminController) GetDashboardStats(c *echo.Context) error

func (*IndexerAdminController) GetNNTPStats added in v0.8.0

func (ctrl *IndexerAdminController) GetNNTPStats(c *echo.Context) error

func (*IndexerAdminController) GetOverview added in v0.7.0

func (ctrl *IndexerAdminController) GetOverview(c *echo.Context) error

func (*IndexerAdminController) GetRecoveryCapacity added in v0.8.0

func (ctrl *IndexerAdminController) GetRecoveryCapacity(c *echo.Context) error

func (*IndexerAdminController) GetRelease added in v0.7.0

func (ctrl *IndexerAdminController) GetRelease(c *echo.Context) error

func (*IndexerAdminController) GetRun added in v0.7.0

func (ctrl *IndexerAdminController) GetRun(c *echo.Context) error

func (*IndexerAdminController) GetStage added in v0.7.0

func (ctrl *IndexerAdminController) GetStage(c *echo.Context) error

func (*IndexerAdminController) GetStageThroughput added in v0.7.2

func (ctrl *IndexerAdminController) GetStageThroughput(c *echo.Context) error

func (*IndexerAdminController) GetStorageAudit added in v0.8.0

func (ctrl *IndexerAdminController) GetStorageAudit(c *echo.Context) error

func (*IndexerAdminController) GetStorageStatus added in v0.8.0

func (ctrl *IndexerAdminController) GetStorageStatus(c *echo.Context) error

func (*IndexerAdminController) HideRelease added in v0.7.0

func (ctrl *IndexerAdminController) HideRelease(c *echo.Context) error

func (*IndexerAdminController) IdentifyRelease added in v0.8.0

func (ctrl *IndexerAdminController) IdentifyRelease(c *echo.Context) error

func (*IndexerAdminController) ListArticleCohorts added in v0.8.0

func (ctrl *IndexerAdminController) ListArticleCohorts(c *echo.Context) error

func (*IndexerAdminController) ListAttention added in v0.8.0

func (ctrl *IndexerAdminController) ListAttention(c *echo.Context) error

func (*IndexerAdminController) ListBinaries added in v0.8.0

func (ctrl *IndexerAdminController) ListBinaries(c *echo.Context) error

func (*IndexerAdminController) ListDeferredArticleRanges added in v0.8.0

func (ctrl *IndexerAdminController) ListDeferredArticleRanges(c *echo.Context) error

func (*IndexerAdminController) ListGroupProfiles added in v0.8.0

func (ctrl *IndexerAdminController) ListGroupProfiles(c *echo.Context) error

func (*IndexerAdminController) ListMaintenanceTasks added in v0.8.0

func (ctrl *IndexerAdminController) ListMaintenanceTasks(c *echo.Context) error

func (*IndexerAdminController) ListReleases added in v0.7.0

func (ctrl *IndexerAdminController) ListReleases(c *echo.Context) error

func (*IndexerAdminController) ListRuns added in v0.7.0

func (ctrl *IndexerAdminController) ListRuns(c *echo.Context) error

func (*IndexerAdminController) ListStages added in v0.7.0

func (ctrl *IndexerAdminController) ListStages(c *echo.Context) error

func (*IndexerAdminController) PatchMaintenanceTask added in v0.8.0

func (ctrl *IndexerAdminController) PatchMaintenanceTask(c *echo.Context) error

func (*IndexerAdminController) PatchRelease added in v0.7.0

func (ctrl *IndexerAdminController) PatchRelease(c *echo.Context) error

func (*IndexerAdminController) PatchStage added in v0.7.0

func (ctrl *IndexerAdminController) PatchStage(c *echo.Context) error

func (*IndexerAdminController) PauseStage added in v0.7.0

func (ctrl *IndexerAdminController) PauseStage(c *echo.Context) error

func (*IndexerAdminController) ReenrichRelease added in v0.7.0

func (ctrl *IndexerAdminController) ReenrichRelease(c *echo.Context) error

func (*IndexerAdminController) RefreshDashboardStats added in v0.7.2

func (ctrl *IndexerAdminController) RefreshDashboardStats(c *echo.Context) error

func (*IndexerAdminController) ReinspectRelease added in v0.7.0

func (ctrl *IndexerAdminController) ReinspectRelease(c *echo.Context) error

func (*IndexerAdminController) ResumeStage added in v0.7.0

func (ctrl *IndexerAdminController) ResumeStage(c *echo.Context) error

func (*IndexerAdminController) RunMaintenanceTask added in v0.8.0

func (ctrl *IndexerAdminController) RunMaintenanceTask(c *echo.Context) error

func (*IndexerAdminController) RunStage added in v0.7.0

func (ctrl *IndexerAdminController) RunStage(c *echo.Context) error

func (*IndexerAdminController) StreamOverview added in v0.8.0

func (ctrl *IndexerAdminController) StreamOverview(c *echo.Context) error

func (*IndexerAdminController) UnhideRelease added in v0.7.0

func (ctrl *IndexerAdminController) UnhideRelease(c *echo.Context) error

type IndexerController added in v0.7.0

type IndexerController struct {
	Service indexerService
}

func NewIndexerController added in v0.7.0

func NewIndexerController(appCtx *app.Context) *IndexerController

func (*IndexerController) DryRunMaintenanceTask added in v0.8.0

func (ctrl *IndexerController) DryRunMaintenanceTask(c *echo.Context) error

func (*IndexerController) GetBinary added in v0.7.0

func (ctrl *IndexerController) GetBinary(c *echo.Context) error

func (*IndexerController) GetFile added in v0.7.0

func (ctrl *IndexerController) GetFile(c *echo.Context) error

func (*IndexerController) GetOverview added in v0.7.0

func (ctrl *IndexerController) GetOverview(c *echo.Context) error

func (*IndexerController) GetRelease added in v0.7.0

func (ctrl *IndexerController) GetRelease(c *echo.Context) error

func (*IndexerController) ListMaintenanceTasks added in v0.8.0

func (ctrl *IndexerController) ListMaintenanceTasks(c *echo.Context) error

func (*IndexerController) ListReleases added in v0.7.0

func (ctrl *IndexerController) ListReleases(c *echo.Context) error

func (*IndexerController) ListRuns added in v0.7.0

func (ctrl *IndexerController) ListRuns(c *echo.Context) error

func (*IndexerController) ListStages added in v0.7.0

func (ctrl *IndexerController) ListStages(c *echo.Context) error

func (*IndexerController) PatchMaintenanceTask added in v0.8.0

func (ctrl *IndexerController) PatchMaintenanceTask(c *echo.Context) error

func (*IndexerController) PauseStage added in v0.7.0

func (ctrl *IndexerController) PauseStage(c *echo.Context) error

func (*IndexerController) ResumeStage added in v0.7.0

func (ctrl *IndexerController) ResumeStage(c *echo.Context) error

func (*IndexerController) RunMaintenanceTask added in v0.8.0

func (ctrl *IndexerController) RunMaintenanceTask(c *echo.Context) error

func (*IndexerController) RunStage added in v0.7.0

func (ctrl *IndexerController) RunStage(c *echo.Context) error

type IndexerScrapeAdminController added in v0.8.0

type IndexerScrapeAdminController struct {
	// contains filtered or unexported fields
}

func NewIndexerScrapeAdminController added in v0.8.0

func NewIndexerScrapeAdminController(appCtx *app.Context) *IndexerScrapeAdminController

func (*IndexerScrapeAdminController) ApplyWildcardGroups added in v0.8.0

func (ctrl *IndexerScrapeAdminController) ApplyWildcardGroups(c *echo.Context) error

func (*IndexerScrapeAdminController) CrosspostPopularity added in v0.8.0

func (ctrl *IndexerScrapeAdminController) CrosspostPopularity(c *echo.Context) error

func (*IndexerScrapeAdminController) GetConfig added in v0.8.0

func (ctrl *IndexerScrapeAdminController) GetConfig(c *echo.Context) error

func (*IndexerScrapeAdminController) PreviewWildcardGroups added in v0.8.0

func (ctrl *IndexerScrapeAdminController) PreviewWildcardGroups(c *echo.Context) error

func (*IndexerScrapeAdminController) ProviderInventory added in v0.8.0

func (ctrl *IndexerScrapeAdminController) ProviderInventory(c *echo.Context) error

func (*IndexerScrapeAdminController) ScanProviders added in v0.8.0

func (ctrl *IndexerScrapeAdminController) ScanProviders(c *echo.Context) error

func (*IndexerScrapeAdminController) UpdateConfig added in v0.8.0

func (ctrl *IndexerScrapeAdminController) UpdateConfig(c *echo.Context) error

type Limits

type Limits struct {
	Max     int `xml:"max,attr"`
	Default int `xml:"default,attr,omitempty"`
}

type NewznabCaps

type NewznabCaps struct {
	XMLName      xml.Name      `xml:"caps"`
	Server       ServerInfo    `xml:"server"`
	Limits       Limits        `xml:"limits"`
	Registration Registration  `xml:"registration"`
	Searching    Searching     `xml:"searching"`
	Categories   []CapCategory `xml:"categories>category"`
	Groups       []CapGroup    `xml:"groups>group"`
	Genres       []CapGenre    `xml:"genres>genre"`
}

-- CAPABILITIES (t=caps) ---

type NewznabController

type NewznabController struct {
	Service aggregatorService
}

func NewNewznabController added in v0.6.0

func NewNewznabController(module app.AggregatorModule) *NewznabController

func (*NewznabController) Handle

func (ctrl *NewznabController) Handle(c *echo.Context) error

Handle is the main Newznab entry point

func (*NewznabController) HandleDownload

func (ctrl *NewznabController) HandleDownload(c *echo.Context) error

handleDownload serves the actual NZB file from cache or source

type NewznabErrorResponse added in v0.6.0

type NewznabErrorResponse struct {
	XMLName     xml.Name `xml:"error"`
	Code        int      `xml:"code,attr"`
	Description string   `xml:"description,attr"`
}

type NewznabRSS

type NewznabRSS struct {
	XMLName xml.Name `xml:"rss"`
	Version string   `xml:"version,attr"`
	NS      string   `xml:"xmlns:newznab,attr"`
	Channel Channel  `xml:"channel"`
}

-- SEARCH RESULTS (t=search/tv/movie)

type QueueController added in v0.6.0

type QueueController struct {
	Commands app.DownloaderCommands
	Queries  app.DownloaderQueries
}

func NewQueueController added in v0.6.1

func NewQueueController(module app.DownloaderModule) *QueueController

func (*QueueController) Add added in v0.6.0

func (ctrl *QueueController) Add(c *echo.Context) error

func (*QueueController) Cancel added in v0.6.0

func (ctrl *QueueController) Cancel(c *echo.Context) error

func (*QueueController) CancelMany added in v0.6.0

func (ctrl *QueueController) CancelMany(c *echo.Context) error

func (*QueueController) ClearHistory added in v0.6.0

func (ctrl *QueueController) ClearHistory(c *echo.Context) error

func (*QueueController) DeleteMany added in v0.6.0

func (ctrl *QueueController) DeleteMany(c *echo.Context) error

func (*QueueController) GetItem added in v0.6.0

func (ctrl *QueueController) GetItem(c *echo.Context) error

func (*QueueController) GetItemEvents added in v0.6.0

func (ctrl *QueueController) GetItemEvents(c *echo.Context) error

func (*QueueController) GetItemFiles added in v0.6.0

func (ctrl *QueueController) GetItemFiles(c *echo.Context) error

func (*QueueController) ListActive added in v0.6.0

func (ctrl *QueueController) ListActive(c *echo.Context) error

func (*QueueController) ListHistory added in v0.6.0

func (ctrl *QueueController) ListHistory(c *echo.Context) error

type RSSGUID

type RSSGUID struct {
	Value       string `xml:",chardata"`
	IsPermaLink bool   `xml:"isPermaLink,attr"`
}

type RSSItem

type RSSItem struct {
	Title      string    `xml:"title"`
	GUID       RSSGUID   `xml:"guid"`
	Link       string    `xml:"link"`
	Category   string    `xml:"category"`
	PubDate    string    `xml:"pubDate"`
	Enclosure  Enclosure `xml:"enclosure"`
	Attributes []Attr    `xml:"newznab:attr"`
}

type Registration added in v0.6.0

type Registration struct {
	Available string `xml:"available,attr"`
	Open      string `xml:"open,attr"`
}

type Response

type Response struct {
	Offset int `xml:"offset,attr"`
	Total  int `xml:"total,attr"`
}

type SABController added in v0.6.0

type SABController struct {
	Commands      app.DownloaderCommands
	Queries       app.DownloaderQueries
	CurrentConfig func() *config.Config
}

func NewSABController added in v0.6.1

func NewSABController(module app.DownloaderModule, currentConfig func() *config.Config) *SABController

func (*SABController) Handle added in v0.6.0

func (ctrl *SABController) Handle(c *echo.Context) error

type SearchCapability added in v0.6.0

type SearchCapability struct {
	Available       string `xml:"available,attr"`
	SupportedParams string `xml:"supportedParams,attr"`
}

type Searching added in v0.6.0

type Searching struct {
	Search   SearchCapability `xml:"search"`
	TVSearch SearchCapability `xml:"tv-search"`
	Movie    SearchCapability `xml:"movie-search"`
}

type ServerInfo

type ServerInfo struct {
	AppVersion string `xml:"appversion,attr,omitempty"`
	Version    string `xml:"version,attr"`
	Title      string `xml:"title,attr"`
	Strapline  string `xml:"strapline,attr,omitempty"`
	Email      string `xml:"email,attr,omitempty"`
	URL        string `xml:"url,attr,omitempty"`
	Image      string `xml:"image,attr,omitempty"`
}

type SettingsController added in v0.6.0

type SettingsController struct {
	Service settingsService
}

func NewSettingsController added in v0.6.0

func NewSettingsController(admin app.SettingsAdmin) *SettingsController

func (*SettingsController) GetCapabilities added in v0.7.1

func (ctrl *SettingsController) GetCapabilities(c *echo.Context) error

func (*SettingsController) GetSettings added in v0.6.0

func (ctrl *SettingsController) GetSettings(c *echo.Context) error

func (*SettingsController) UpdateSettings added in v0.6.0

func (ctrl *SettingsController) UpdateSettings(c *echo.Context) error

Jump to

Keyboard shortcuts

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