db

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbTextType = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func NewDatabase

func NewDatabase(c *utils.Configs, a *auth.Authorization, s *core.Storage,
	l *utils.Log) *Database

func (*Database) AddFilename

func (d *Database) AddFilename(db string, fileName string)

func (*Database) LoadDeviceBase

func (d *Database) LoadDeviceBase() error

func (*Database) LoadProfileBase

func (d *Database) LoadProfileBase() error

func (*Database) LoadRelayBase

func (d *Database) LoadRelayBase() error

func (*Database) SaveDeviceBase

func (d *Database) SaveDeviceBase() error

func (*Database) SaveProfileBase

func (d *Database) SaveProfileBase() error

func (*Database) SaveRelayBase

func (d *Database) SaveRelayBase(name string, status bool) error

func (*Database) SetDBType

func (d *Database) SetDBType(typ string)

type DeviceDB

type DeviceDB struct {
	Devices []SingleDeviceDb `json:"devices"`
}

type ProfileDB

type ProfileDB struct {
	Profiles []SingleProfileDB `json:"profiles"`
}

type ProfileDeivceDB

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

type RelaysDB

type RelaysDB struct {
	Relays []SingleRelayDB `json:"relays"`
}

type SingleDeviceDb

type SingleDeviceDb struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
}

type SingleProfileDB

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

type SingleRelayDB

type SingleRelayDB struct {
	Name   string `json:"name"`
	Status bool   `json:"status"`
}

Jump to

Keyboard shortcuts

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