infrastructure

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginURI           = "api/login"
	StatAlarmURI       = "api/s/%s/stat/alarm"
	StatEventURI       = "api/s/%s/stat/event"
	StatDeviceBasicURI = "api/s/%s/stat/device-basic"
	ListUserURI        = "api/s/%s/list/user"
	ContentType        = "application/json;charset=UTF-8"
	AuthCookieName     = "unifises"
	AuthCookieDuration = time.Minute * 19
	PaginateBy         = 20
)

Variables

This section is empty.

Functions

func NewLogHandler

func NewLogHandler(config model.LoggerConfig) (*logrus.Logger, error)

Types

type SlackHandler

type SlackHandler struct {
	Config model.SlackConfig
	Logger *logrus.Logger
}

func NewSlackHandler

func NewSlackHandler(config model.SlackConfig, logger *logrus.Logger) SlackHandler

func (*SlackHandler) NotifyAlarms

func (h *SlackHandler) NotifyAlarms(unifiSiteAlarms model.UnifiSiteAlarms) error

func (*SlackHandler) NotifyEvents

func (h *SlackHandler) NotifyEvents(unifiSiteEvents model.UnifiSiteEvents) error

type UnifiHandler

type UnifiHandler struct {
	Config     model.UnifiConfig
	HTTPClient http.Client
	Logger     *logrus.Logger
}

func NewUnifiHandler

func NewUnifiHandler(config model.UnifiConfig, httpClient http.Client, logger *logrus.Logger) UnifiHandler

func (*UnifiHandler) GetAlarms

func (h *UnifiHandler) GetAlarms(since time.Time) (model.UnifiSiteAlarms, error)

func (*UnifiHandler) GetEvents

func (h *UnifiHandler) GetEvents(since time.Time) (model.UnifiSiteEvents, error)

Jump to

Keyboard shortcuts

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