client

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 68 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHeader = fmt.Errorf("invalid header provided; must contain a colon")
)

Errors.

View Source
var (
	ErrNilAPIKey = fmt.Errorf("API key may not be empty: set a key in config file, OR with environment variable")
)

Errors returned by this package.

Functions

func Fortune added in v0.3.2

func Fortune() string

Fortune returns a fortune.

func Start

func Start() error

Start runs the app.

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" as of its creation.
	sync.RWMutex
	// contains filtered or unexported fields
}

Client stores all the running data.

func (*Client) AutoWatchUpdate

func (c *Client) AutoWatchUpdate()

AutoWatchUpdate is not used on this OS.

func (*Client) Exit

func (c *Client) Exit() error

Exit stops the web server and logs our exit messages. Start() calls this.

func (*Client) ParseGUITemplates added in v0.3.0

func (c *Client) ParseGUITemplates() error

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.

func (*Client) PrintStartupInfo

func (c *Client) PrintStartupInfo(clientInfo *website.ClientInfo)

PrintStartupInfo prints info about our startup config. This runs once on startup, and again during reloads.

func (*Client) StartWebServer

func (c *Client) StartWebServer()

StartWebServer starts the web server.

func (*Client) StopWebServer

func (c *Client) StopWebServer() error

StopWebServer stops the web servers. Panics if that causes an error or timeout.

type Timer added in v0.3.2

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

Timer is used to set a cooldown time.

func (*Timer) Active added in v0.3.2

func (t *Timer) Active(d time.Duration) bool

Active returns true if a timer is active, otherwise it becomes active.

Jump to

Keyboard shortcuts

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