api

package
v0.0.0-...-d25a9c8 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: GPL-3.0, GPL-3.0-only Imports: 35 Imported by: 0

Documentation

Overview

Package api for Conductorr.

This package provides an API for communicating with the Conductorr backend.

    Schemes: http, https
    BasePath: /v1
    Version: 1.0.0
    License: GPL-3.0 https://www.gnu.org/licenses/gpl-3.0.html

    Consumes:
    - application/json

    Produces:
    - application/json

    Security:
    - api_key:
	   - auth_token:

    SecurityDefinitions:
    api_key:
         type: apiKey
         name: x-token
         in: header
	   auth_token:
			type:
    oauth2:
        type: oauth2
        authorizationUrl: /oauth2/auth
        tokenUrl: /oauth2/token
        in: header
        scopes:
          bar: foo
        flow: accessCode

    Extensions:
    x-meta-value: value
    x-meta-array:
      - value1
      - value2
    x-meta-array-obj:
      - name: obj
        value: field

swagger:meta

Index

Constants

View Source
const UserAuthKey = "id_token"

Variables

This section is empty.

Functions

func AddMedia

func AddMedia(w http.ResponseWriter, r *http.Request)

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

func CheckAuth

func CheckAuth(w http.ResponseWriter, r *http.Request)

func CheckMediaPath

func CheckMediaPath(path string) (bool, int64)

func CreateIndexer

func CreateIndexer(w http.ResponseWriter, r *http.Request)

func CreateNewBackup

func CreateNewBackup(w http.ResponseWriter, r *http.Request)

CreateNewbackup godoc swagger:route POST /api/v1/backup backup Create a new backup file

security: - apiKey: [] - responses: 401: CommonError 200: CommonSuccess

func CreateProfile

func CreateProfile(w http.ResponseWriter, r *http.Request)

func DeleteDownloader

func DeleteDownloader(w http.ResponseWriter, r *http.Request)

func DeleteIndexer

func DeleteIndexer(w http.ResponseWriter, r *http.Request)

func DeleteMedia

func DeleteMedia(w http.ResponseWriter, r *http.Request)

func DeleteMediaServer

func DeleteMediaServer(w http.ResponseWriter, r *http.Request)

func DeletePath

func DeletePath(w http.ResponseWriter, r *http.Request)

func DeleteProfile

func DeleteProfile(w http.ResponseWriter, r *http.Request)

func DownloadMediaRelease

func DownloadMediaRelease(w http.ResponseWriter, r *http.Request)

func FetchPlexAuthToken

func FetchPlexAuthToken(w http.ResponseWriter, r *http.Request)

func FetchScript

func FetchScript(w http.ResponseWriter, r *http.Request)

func FirstTime

func FirstTime(w http.ResponseWriter, r *http.Request)

func GenerateIDToken

func GenerateIDToken() (string, error)

func GetActiveDownloads

func GetActiveDownloads(w http.ResponseWriter, r *http.Request)

func GetBackupFile

func GetBackupFile(w http.ResponseWriter, r *http.Request)

GetBackupFile swagger:route GET /api/v1/backup/{id} backup Download URL for a recently-generated backup file

func GetDoneDownloads

func GetDoneDownloads(w http.ResponseWriter, r *http.Request)

func GetDownloaders

func GetDownloaders(w http.ResponseWriter, r *http.Request)

func GetIndexer

func GetIndexer(w http.ResponseWriter, r *http.Request)

func GetIndexers

func GetIndexers(w http.ResponseWriter, r *http.Request)

func GetLogFile

func GetLogFile(w http.ResponseWriter, r *http.Request)

func GetLogs

func GetLogs(w http.ResponseWriter, r *http.Request)

func GetMedia

func GetMedia(w http.ResponseWriter, r *http.Request)

func GetMediaServers

func GetMediaServers(w http.ResponseWriter, r *http.Request)

func GetPaths

func GetPaths(w http.ResponseWriter, r *http.Request)

func GetPoster

func GetPoster(w http.ResponseWriter, r *http.Request)

func GetProfile

func GetProfile(w http.ResponseWriter, r *http.Request)

func GetProfiles

func GetProfiles(w http.ResponseWriter, r *http.Request)

func GetRawProfileScript

func GetRawProfileScript(w http.ResponseWriter, r *http.Request)

func GetRecentMedia

func GetRecentMedia(w http.ResponseWriter, r *http.Request)

func GetReleaseProfileCfg

func GetReleaseProfileCfg(w http.ResponseWriter, r *http.Request)

func GetRouter

func GetRouter() http.Handler

func GetSchedule

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

func GetStatus

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

func GetTasks

func GetTasks(w http.ResponseWriter, r *http.Request)

func InvalidateAuthCookie

func InvalidateAuthCookie(w http.ResponseWriter, r *http.Request)

func LoadCSL

func LoadCSL(w http.ResponseWriter, r *http.Request)

func NewDBPathFromPath

func NewDBPathFromPath(path Path) dbstore.Path

func NewDownloader

func NewDownloader(w http.ResponseWriter, r *http.Request)

func NewMediaServer

func NewMediaServer(w http.ResponseWriter, r *http.Request)

func NewPath

func NewPath(w http.ResponseWriter, r *http.Request)

func RefreshMediaMetadata

func RefreshMediaMetadata(w http.ResponseWriter, r *http.Request)

func Respond

func Respond(w http.ResponseWriter, req *http.Request, err error, data interface{}, authorize bool)

func RestoreBackupFromFile

func RestoreBackupFromFile(w http.ResponseWriter, r *http.Request)

func SearchLibraryByTitle

func SearchLibraryByTitle(w http.ResponseWriter, r *http.Request)

func SearchNewByTitle

func SearchNewByTitle(w http.ResponseWriter, r *http.Request)

func SearchReleasesAuto

func SearchReleasesAuto(w http.ResponseWriter, r *http.Request)

func SearchReleasesManual

func SearchReleasesManual(w http.ResponseWriter, r *http.Request)

func SetMonitoringMedia

func SetMonitoringMedia(w http.ResponseWriter, r *http.Request)

func SignIn

func SignIn(w http.ResponseWriter, r *http.Request)

func SignUp

func SignUp(w http.ResponseWriter, r *http.Request)

func TestDownloader

func TestDownloader(w http.ResponseWriter, r *http.Request)

func TestIndexer

func TestIndexer(w http.ResponseWriter, r *http.Request)

func TestMediaServer

func TestMediaServer(w http.ResponseWriter, r *http.Request)

func TestPath

func TestPath(w http.ResponseWriter, r *http.Request)

func UpdateDownloader

func UpdateDownloader(w http.ResponseWriter, r *http.Request)

func UpdateIndexer

func UpdateIndexer(w http.ResponseWriter, r *http.Request)

func UpdateMedia

func UpdateMedia(w http.ResponseWriter, r *http.Request)

func UpdateMediaServer

func UpdateMediaServer(w http.ResponseWriter, r *http.Request)

func UpdatePath

func UpdatePath(w http.ResponseWriter, r *http.Request)

func UpdateProfile

func UpdateProfile(w http.ResponseWriter, r *http.Request)

Types

type AddMediaInput

type AddMediaInput struct {
	ProfileID  int  `json:"profileID,omitempty"`
	PathID     int  `json:"pathID,omitempty"`
	Monitoring bool `json:"monitoring"`
}

type AuthInput

type AuthInput struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type AuthTokenResponse

type AuthTokenResponse struct {
	Token string `json:"token"`
}

type DownloadResponse

type DownloadResponse struct {
	ID           int       `json:"id"`
	MediaID      int       `json:"mediaID"`
	FriendlyName string    `json:"friendlyName"`
	Identifier   string    `json:"identifier"`
	FinalDir     string    `json:"finalDir"`
	Status       string    `json:"status"`
	Started      time.Time `json:"started"`
	BytesLeft    uint64    `json:"bytesLeft"`
	FullSize     uint64    `json:"fullSize"`
}

func NewDownloadResponseFromDBDownload

func NewDownloadResponseFromDBDownload(dl dbstore.Download) (dlr DownloadResponse)

func NewDownloadResponseFromManagedDownload

func NewDownloadResponseFromManagedDownload(dl app.ManagedDownload) (dlr DownloadResponse)

type DownloaderInput

type DownloaderInput struct {
	Name           string                 `json:"name,omitempty"`
	DownloaderType string                 `json:"downloaderType,omitempty"`
	FileAction     string                 `json:"fileAction,omitempty"`
	Config         map[string]interface{} `json:"config,omitempty"`
}

type DownloaderResponse

type DownloaderResponse struct {
	ID             int                    `json:"id,omitempty"`
	Name           string                 `json:"name,omitempty"`
	DownloaderType string                 `json:"downloaderType,omitempty"`
	FileAction     string                 `json:"fileAction,omitempty"`
	Config         map[string]interface{} `json:"config,omitempty"`
}

type Event

type Event struct {
	Timestamp   time.Time `json:"timestamp,omitempty"`
	MediaID     int       `json:"mediaID,omitempty"`
	Title       string    `json:"title,omitempty"`
	Description string    `json:"description,omitempty"`
	ContentType string    `json:"contentType,omitempty"`
	SeasonNum   int       `json:"seasonNum,omitempty"`
	EpisodeNum  int       `json:"episodeNum,omitempty"`
	SeriesID    int       `json:"seriesID,omitempty"`
	SeriesTitle string    `json:"seriesTitle,omitempty"`
	Monitoring  bool      `json:"monitoring,omitempty"`
	PathOK      bool      `json:"pathOk,omitempty"`
}

type FetchPlexAuthTokenInput

type FetchPlexAuthTokenInput struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
}

type IndexerInput

type IndexerInput struct {
	Name         string `json:"name"`
	UserID       int    `json:"userID,omitempty"`
	BaseUrl      string `json:"baseUrl,omitempty"`
	ApiKey       string `json:"apiKey,omitempty"`
	ForMovies    bool   `json:"forMovies,omitempty"`
	ForSeries    bool   `json:"forSeries,omitempty"`
	DownloadType string `json:"downloadType,omitempty"`
}

type IndexerResponse

type IndexerResponse struct {
	IndexerInput
	ID int `json:"id,omitempty"`
}

func NewIndexerResponseFromDB

func NewIndexerResponseFromDB(dbIndexer dbstore.Indexer) IndexerResponse

type Interval

type Interval struct {
	MinVal float64 `json:"minVal,omitempty"`
	MaxVal float64 `json:"maxVal,omitempty"`
}

type LogResponse

type LogResponse struct {
	Timestamp time.Time `json:"timestamp,omitempty"`
	Variant   string    `json:"variant,omitempty"`
	Msg       string    `json:"msg,omitempty"`
}

type MediaInput

type MediaInput struct {
	ID            int        `json:"id,omitempty"`
	Title         string     `json:"title,omitempty"`
	Description   string     `json:"description,omitempty"`
	ReleasedAt    time.Time  `json:"releasedAt,omitempty"`
	EndedAt       *time.Time `json:"endedAt,omitempty"`
	ContentType   string     `json:"contentType,omitempty"`
	Poster        string     `json:"poster,omitempty"`
	ParentMediaID int        `json:"parentMediaID,omitempty"`
	TmdbID        int        `json:"tmdbID,omitempty"`
	ImdbID        string     `json:"imdbID,omitempty"`
	TmdbRating    int        `json:"tmdbRating,omitempty"`
	ImdbRating    int        `json:"imdbRating,omitempty"`
	Runtime       int        `json:"runtime,omitempty"`
	ProfileID     int        `json:"profileID,omitempty"`
	PathID        int        `json:"pathID,omitempty"`
}

type MediaResponse

type MediaResponse struct {
	ID            int        `json:"id,omitempty"`
	Title         string     `json:"title,omitempty"`
	Description   string     `json:"description,omitempty"`
	ReleasedAt    time.Time  `json:"releasedAt,omitempty"`
	EndedAt       *time.Time `json:"endedAt,omitempty"`
	ContentType   string     `json:"contentType,omitempty"`
	Poster        string     `json:"poster,omitempty"`
	ParentMediaID int        `json:"parentMediaID,omitempty"`
	TmdbID        int        `json:"tmdbID,omitempty"`
	ImdbID        string     `json:"imdbID,omitempty"`
	TmdbRating    int        `json:"tmdbRating,omitempty"`
	ImdbRating    int        `json:"imdbRating,omitempty"`
	Runtime       int        `json:"runtime,omitempty"`
	ProfileID     int        `json:"profileID,omitempty"`
	PathID        int        `json:"pathID,omitempty"`
	Number        int        `json:"number,omitempty"`
	Monitoring    bool       `json:"monitoring"`
	Path          string     `json:"path"`
	PathOK        bool       `json:"pathOk"`
	Size          int64      `json:"size"`

	SearchID string `json:"searchID,omitempty"`

	Children []MediaResponse `json:"children,omitempty"`
	// contains filtered or unexported fields
}

func NewMediaResponseFromDB

func NewMediaResponseFromDB(media dbstore.Media, checkPath bool) (m MediaResponse)

func NewMediaResponseFromIndividual

func NewMediaResponseFromIndividual(media search.IndividualResult) (m MediaResponse)

func NewMediaResponseFromSearch

func NewMediaResponseFromSearch(media search.SearchResult) (m MediaResponse)

func (*MediaResponse) Expand

func (mr *MediaResponse) Expand() error

Expand a media response with all the recursively referenced children

type MediaServerInput

type MediaServerInput struct {
	Name            string                 `json:"name,omitempty"`
	MediaServerType string                 `json:"mediaServerType,omitempty"`
	Config          map[string]interface{} `json:"config,omitempty"`
}

type MediaServerResponse

type MediaServerResponse struct {
	ID              int                    `json:"id,omitempty"`
	Name            string                 `json:"name,omitempty"`
	MediaServerType string                 `json:"mediaServerType,omitempty"`
	Config          map[string]interface{} `json:"config,omitempty"`
}

type MonitoringInput

type MonitoringInput struct {
	Monitoring bool `json:"monitoring"`
}

type NewProfile

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

type Path

type Path struct {
	ID            int    `json:"id,omitempty"`
	Path          string `json:"path,omitempty"`
	MoviesDefault bool   `json:"moviesDefault,omitempty"`
	SeriesDefault bool   `json:"seriesDefault,omitempty"`
}

func NewPathFromDBPath

func NewPathFromDBPath(p dbstore.Path) Path

type PathInput

type PathInput struct {
	Path string `json:"path,omitempty"`
}

type Profile

type Profile struct {
	ID     int    `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Filter string `json:"filter,omitempty"`
	Sorter string `json:"sorter,omitempty"`
}

func NewProfileFromDB

func NewProfileFromDB(dbProfile *dbstore.Profile) Profile

type SearchResponse

type SearchResponse struct {
	TotalResults int             `json:"totalResults"`
	PerPage      int             `json:"perPage"`
	Results      []MediaResponse `json:"results"`
}

Jump to

Keyboard shortcuts

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