rest

package
v0.0.0-...-02f0e95 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: BSD-2-Clause Imports: 21 Imported by: 0

README

Overview

httpd module provides the REST API and the static file service for the javascript UI

This is REST-like but not REST...

https://www.youtube.com/watch?v=0gH-hSyWp9o

TODO

write a swagger definition

Documentation

Index

Constants

View Source
const (
	AuthLevelView    authLevel = iota // view can see running system state
	AuthLevelControl                  // control can manually stop/start devices and adjust schedule entries
	AuthLevelAdmin                    // admin can stop the system and change heat/cool
)
View Source
const BcryptRounds = 14

used in the cli to add/update users, should probably just be moved there

Variables

This section is empty.

Functions

func Start

func Start(c *hvac.Config, done <-chan bool)

Start launches the HTTP server which is responsible for the frontend and the HTTP API.

Types

type AuthData

type AuthData struct {
	Username string
	PwHash   string
	Level    authLevel
}

func LoadAuth

func LoadAuth(path string) ([]AuthData, error)

LoadAuth loads the auth config file, exported since the cli tool uses it

Jump to

Keyboard shortcuts

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