apiwatcher

package
v0.0.0-...-f44ad72 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInfo

type APIInfo struct {
	DevicesInfo map[string]DeviceInfo
	Time        int64
}

type APIWatcher

type APIWatcher struct {
	Host string
	Port int
}

func (APIWatcher) ShowInfo

func (watcher APIWatcher) ShowInfo(alarmManager AlarmManagerRequester) (APIInfo, error)

type AlarmManagerRequester

type AlarmManagerRequester interface {
	CallAlarmManager(req *http.Request) (*http.Response, error)
}

type DeviceInfo

type DeviceInfo struct {
	Online bool
	Firing bool
	Mode   string
	Name   string
}

type DeviceInfoRequest

type DeviceInfoRequest struct {
	Success bool   `json:"success"`
	Msg     string `json:"msg"`
	Mode    string `json:"mode"`
	Firing  bool   `json:"firing"`
	Online  bool   `json:"online"`
}

type DevicesInfoRequest

type DevicesInfoRequest struct {
	Success bool              `json:"success"`
	Data    map[string]string `json:"data"`
}

type Requester

type Requester struct {
	Client http.Client
}

func (Requester) CallAlarmManager

func (requester Requester) CallAlarmManager(req *http.Request) (*http.Response, error)

type Watcher

type Watcher interface {
	ShowInfo(http.Client) (APIInfo, error)
}

Jump to

Keyboard shortcuts

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