Documentation ¶
Overview ¶
Package client provides the low level assembly of the Notifiarr client application. This package orchestrates reading in of configuration, parsing cli flags, actioning those cli flags, setting up logging, and finally the starting of internal service routines for the webserver, plex sessions, snapshots, service checks and others. This package sets everything up for the client application.
Index ¶
- Variables
- func Fortune() string
- func Start() error
- type Client
- func (c *Client) Exit(ctx context.Context) error
- func (c *Client) ParseGUITemplates() error
- func (c *Client) PlexHandler(w http.ResponseWriter, r *http.Request)
- func (c *Client) PrintStartupInfo(ctx context.Context, clientInfo *clientinfo.ClientInfo)
- func (c *Client) StartWebServer(ctx context.Context)
- func (c *Client) StopWebServer(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnsupport = errors.New("this feature is not supported on this platform") ErrNilAPIKey = errors.New("API key may not be empty: set a key in config file, OR with environment variable") )
Errors returned by this package.
var (
ErrInvalidHeader = errors.New("invalid header provided; must contain a colon")
)
Errors.
Functions ¶
Types ¶
type Client ¶
type Client struct { *logs.Logger Flags *configfile.Flags Config *configfile.Config // this locks anything that may be updated while running. // at least "UIPassword" and "reloading" as of its creation. sync.RWMutex // contains filtered or unexported fields }
Client stores all the running data.
func (*Client) ParseGUITemplates ¶ added in v0.3.0
ParseGUITemplates parses the baked-in templates, and overrides them if a template directory is provided.
func (*Client) PlexHandler ¶ added in v0.3.2
func (c *Client) PlexHandler(w http.ResponseWriter, r *http.Request)
PlexHandler handles an incoming webhook from Plex. @Summary Accept Plex Media Server Webhook @Description Accepts a Plex webhook; when conditions are satisfied sends a notification to the website, @Description and may include snapshot data and/or fetched session data. Does not require X-API-Key header. @Tags Plex @Accept json @Produce text/plain @Param token query string true "Plex Token or Client API Key" @Param POST body plex.IncomingWebhook true "webhook payload" @Success 202 {string} string "accepted" @Success 208 {string} string "ignored" @Failure 400 {string} string "bad input" @Failure 404 {string} string "bad token or api key" @Router /plex [post]
func (*Client) PrintStartupInfo ¶
func (c *Client) PrintStartupInfo(ctx context.Context, clientInfo *clientinfo.ClientInfo)
PrintStartupInfo prints info about our startup config. This runs once on startup, and again during reloads.
func (*Client) StartWebServer ¶
StartWebServer starts the web server.