lib

package
v2.0.0-...-d12a2ef Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 10 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) GetMux

func (a *API) GetMux() 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) UpdateDevice

func (db *DB) UpdateDevice(device *Device) error

type DBConfig

type DBConfig struct {
	Host string
	Port int
}

type DBInterface

type DBInterface interface {
	GetDevices() ([]*Device, error)
	GetDevice(mac string) (*Device, error)
	UpdateDevice(device *Device) error
}

type Device

type Device struct {
	MAC               string `json:"mac" redis:"mac"`
	CurrentFirmware   string `json:"currentFirmware" redis:"currentFirmware"`
	CurrentVersion    string `json:"currentVersion" redis:"currentVersion"`
	AssignedFirmware  string `json:"assignedFirmware" redis:"assignedFirmware"`
	AssignedVersion   string `json:"assignedVersion" redis:"assignedVersion"`
	AcceptsPrerelease bool   `json:"acceptsPrerelease" redis:"acceptsPrerelease"`
}

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