api

package
v0.0.0-...-6d248b5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: GPL-3.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//
	// Common API
	//
	HttpReqGroupList = "/user/{user}/groups"
	HttpReqDevList   = "/user/{user}/device"
	HttpReqDevRemove = "/user/{user}/device/del/id/{id}"
	HttpReqDevAdd    = "/user/{user}/device/add/name/{name}/desc/{desc}/type/{type}"
	HttpReqDevByDesc = "/user/{user}/device/desc/{desc}"

	HttpReqProfList      = "/user/{user}/profile"
	HttpReqProfAdd       = "/user/{user}/profile/add/name/{name}/key/{key}/admin/{admin}"
	HttpReqProfRemove    = "/user/{user}/profile/del/name/{name}"
	HttpReqProfAddDev    = "/user/{user}/profile/name/{name}/add/device/{device}/read/{read}/write/{write}"
	HttpReqProfAddGrp    = "/user/{user}/profile/name/{name}/add/group/{group}"
	HttpReqProfDevRemove = "/user/{user}/profile/name/{name}/del/device/{device}"
	HttpReqProfGrpRemove = "/user/{user}/profile/name/{name}/del/group/{group}"

	//
	// Relay API
	//
	HttpReqRelayList   = "/user/{user}/relay"
	HttpReqRelayStatus = "/user/{user}/relay/{id}"
	HttpReqRelaySwitch = "/user/{user}/relay/{id}/switch"
	HttpReqRelaySet    = "/user/{user}/relay/{id}/set/{status}"
	HttpReqRelayUpdate = "/user/{user}/relay/{id}/update/state/{state}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceListResponse

type DeviceListResponse struct {
	Operation string                 `json:"operation"`
	Result    bool                   `json:"result"`
	Error     string                 `json:"error"`
	Devices   []DeviceSingleResponse `json:"devices"`
}

type DeviceResponse

type DeviceResponse struct {
	Operation   string `json:"operation"`
	Result      bool   `json:"result"`
	Error       string `json:"error"`
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Online      bool   `json:"online"`
}

type DeviceSingleResponse

type DeviceSingleResponse struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Online      bool   `json:"online"`
}

type GroupResponse

type GroupResponse struct {
	Operation string   `json:"operation"`
	Result    bool     `json:"result"`
	Error     string   `json:"error"`
	Groups    []string `json:"groups"`
}

type ProfileDeviceResponse

type ProfileDeviceResponse struct {
	Name  string `json:"name"`
	Read  bool   `json:"read"`
	Write bool   `json:"write"`
}

type ProfileListResponse

type ProfileListResponse struct {
	Operation string                  `json:"operation"`
	Result    bool                    `json:"result"`
	Error     string                  `json:"error"`
	Profiles  []ProfileSingleResponse `json:"profiles"`
}

type ProfileSingleResponse

type ProfileSingleResponse struct {
	Name    string                  `json:"name"`
	Key     string                  `json:"key"`
	Admin   bool                    `json:"admin"`
	Groups  []string                `json:"groups"`
	Devices []ProfileDeviceResponse `json:"devices"`
}

type RelayDevResponse

type RelayDevResponse struct {
	Operation string                   `json:"operation"`
	Result    bool                     `json:"result"`
	Error     string                   `json:"error"`
	Relays    []RelaySingleDevResponse `json:"relays"`
}

type RelayResponse

type RelayResponse struct {
	Operation string `json:"operation"`
	Result    bool   `json:"result"`
	Error     string `json:"error"`
	Status    bool   `json:"status"`
	State     bool   `json:"state"`
}

type RelaySingleDevResponse

type RelaySingleDevResponse struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Online      bool   `json:"online"`
	Status      bool   `json:"status"`
	State       bool   `json:"state"`
}

Jump to

Keyboard shortcuts

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