internal

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

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	DB        DBInterface
	LogOutput io.Writer
}

func (*API) GetHttpHandler

func (a *API) GetHttpHandler() http.Handler

type DB

type DB struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(config *DBConfig) *DB

func (*DB) GetDevice

func (db *DB) GetDevice(mac string) (*Device, error)

func (*DB) GetDevices

func (db *DB) GetDevices() ([]*Device, error)

func (*DB) SetDeviceField

func (db *DB) SetDeviceField(mac, key, value string) error

func (*DB) UpdateDevice

func (db *DB) UpdateDevice(mac, firmwareType, firmwareVersion string) error

type DBConfig

type DBConfig struct {
	Host string
	Port int
}

type DBInterface

type DBInterface interface {
	GetDevices() ([]*Device, error)
	GetDevice(mac string) (*Device, error)
	UpdateDevice(mac, firmwareType, firmwareVersion string) error
	SetDeviceField(mac, key, value string) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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