Documentation
¶
Index ¶
- Constants
- func New(id, model, name string, fs embed.FS, targets []string) dean.Thinger
- type Device
- func (d *Device) API(w http.ResponseWriter, r *http.Request, data any)
- func (d *Device) CopyWifiAuth(auth WifiAuth)
- func (d *Device) DescHtml() []byte
- func (d *Device) FailSafe()
- func (d *Device) GenerateUf2s(dir string) error
- func (d *Device) GetDeployParams() string
- func (d *Device) Icon() []byte
- func (d Device) LoadModule() Module
- func (d *Device) ParamFirstValue(key string) string
- func (d *Device) RenderTemplate(w http.ResponseWriter, name string, data any)
- func (d *Device) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (d *Device) SetDeployParams(params string)
- func (d *Device) SetDialURLs(urls string)
- func (d *Device) SetLocked(locked bool)
- func (d *Device) SetWifiAuth(ssids, passphrases string)
- func (d *Device) SetWsScheme(scheme string)
- func (d *Device) Setup()
- func (d *Device) SupportedTargets() string
- type Devicer
- type Modeler
- type Module
- type ViewMode
- type WifiAuth
Constants ¶
View Source
const UF2Magic = "Call the Doctor! Miss you Dan."
Random string to embed in UF2 we can search for later to locate params
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct {
// Device is a Thing
dean.Thing
// Targets supported by device
target.Targets `json:"-"`
// ModelStruct is the model with first letter upper-case
ModelStruct string `json:"-"`
// WIfiAuth is a map of SSID:PASSPHRASE pairs
WifiAuth `json:"-"`
// DialURLs is a comma seperated list of URLs the device will dial into
DialURLs string `json:"-"`
// DeployParams are device deploy configuration in an html param format
DeployParams string
// ViewMode is current device view mode
ViewMode `json:"-"`
// WsScheme is the websocket scheme to use to call back into the
// device. Default is ws://, which is sutable for an http:// device.
// Set to wss:// if dialing back into an https:// device.
WsScheme string `json:"-"`
// Administratively locked
Locked bool `json:"-"`
// contains filtered or unexported fields
}
func (*Device) API ¶
API is the base device's API. Derived devices can have their own API function to overide or extend this API.
func (*Device) CopyWifiAuth ¶
func (*Device) GenerateUf2s ¶
func (*Device) GetDeployParams ¶
func (Device) LoadModule ¶
func (*Device) ParamFirstValue ¶
ParamFirstValue returns the first value os html param named by key
func (*Device) RenderTemplate ¶
func (d *Device) RenderTemplate(w http.ResponseWriter, name string, data any)
RenderTemplate writes the rendered template name using data to writer
func (*Device) ServeHTTP ¶
func (d *Device) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the base device's web server handler for /. Derived devices can override or extend with their own ServeHTTP function.
func (*Device) SetDeployParams ¶
func (*Device) SetDialURLs ¶
func (*Device) SetWifiAuth ¶
func (*Device) SetWsScheme ¶
func (*Device) SupportedTargets ¶
Supported Targets is the base device's targets in full format
Source Files
¶
Click to show internal directories.
Click to hide internal directories.