client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Title            = "Notifiarr"
	DefaultName      = "notifiarr"
	DefaultLogFileMb = 100
	DefaultLogFiles  = 0 // delete none
	DefaultEnvPrefix = "DN"
)

Application Defaults.

Variables

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.

View Source
var ErrNoServer = fmt.Errorf("the web server is not running, cannot stop it")

ErrNoServer returns when the server is already stopped and a stop req occurs.

Functions

func Start

func Start() error

Start runs the app.

Types

type Client

type Client struct {
	*logs.Logger
	Flags  *Flags
	Config *configfile.Config
	// contains filtered or unexported fields
}

Client stores all the running data.

func NewDefaults

func NewDefaults() *Client

NewDefaults returns a new Client pointer with default settings.

func (*Client) AutoWatchUpdate

func (c *Client) AutoWatchUpdate()

func (*Client) Exit

func (c *Client) Exit() (err error)

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

func (*Client) PrintStartupInfo

func (c *Client) PrintStartupInfo()

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 Flags

type Flags struct {
	*flag.FlagSet

	ConfigFile string
	EnvPrefix  string
	Mode       string
	// contains filtered or unexported fields
}

Flags are our CLI input flags.

func (*Flags) ParseArgs

func (f *Flags) ParseArgs(args []string)

ParseArgs stores the cli flag data into the Flags pointer.

Jump to

Keyboard shortcuts

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