utility

package
v0.0.0-...-9fdfd3a Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWrappersToOverseerr

func AddWrappersToOverseerr(o *goverseerr.Overseerr)

AddWrappersToOverseerr ensures that all overseerr requests will be logged

func DeleteOverseerrProfile

func DeleteOverseerrProfile(profileName string) error

WriteOverseerrProfile writes a profile to the configuration

func EmailValidator

func EmailValidator(in string) error

func GetAllOverseerrProfiles

func GetAllOverseerrProfiles() map[string]OverseerrProfile

GetAllOverseerrProfiles returns all configured overseerr profiles and panics if fails

func LocaleValidator

func LocaleValidator(l string) error

func NonEmptyValidator

func NonEmptyValidator(in string) error

func URLValidator

func URLValidator(u string) error

func WriteOverseerrProfile

func WriteOverseerrProfile(profileName string, profile OverseerrProfile, overwrite bool) error

WriteOverseerrProfile writes a profile to the configuration

Types

type OverseerrAuthConfig

type OverseerrAuthConfig struct {
	Type      OverseerrAuthType `json:"type"`
	Key       string            `json:"key,omitempty"`
	Email     string            `json:"email,omitempty"`
	Password  string            `json:"password,omitempty"`
	PlexToken string            `json:"plexToken,omitempty"`
}

OverseerrAuthConfig contains the authorization details for an account

type OverseerrAuthType

type OverseerrAuthType string
const (
	OverseerrAuthTypeKey   OverseerrAuthType = "key"
	OverseerrAuthTypeLocal OverseerrAuthType = "local"
	OverseerrAuthTypePlex  OverseerrAuthType = "plex"
)

func SelectProfileAuthType

func SelectProfileAuthType() OverseerrAuthType

type OverseerrProfile

type OverseerrProfile struct {
	URL           string              `json:"url"`
	CustomHeaders map[string]string   `json:"customHeaders"`
	Locale        string              `json:"locale" default:"en"`
	Auth          OverseerrAuthConfig `json:"auth"`
}

OverseerrProfile contains all the details to login to an account on Overseerr

func GetOverseerrProfile

func GetOverseerrProfile(profileName string) (OverseerrProfile, error)

GetOverseerrProfile returns a configured overseerr profile if it exists. If not, an error is returned

func (OverseerrProfile) Connect

func (p OverseerrProfile) Connect() (*goverseerr.Overseerr, error)

Connect creates a logged in Overseerr instance from a profile

func (OverseerrProfile) QuickValidate

func (c OverseerrProfile) QuickValidate() error

QuickValidate ensures both the URL and Locale are valid for a profile

Jump to

Keyboard shortcuts

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