Documentation ¶
Overview ¶
Package dvrDbOps provides database interactions for dvr database Includes basic CRUD functions as well as initializing the database upon init
Index ¶
- Constants
- func AddNewDvr(newDvr *Dvr) bool
- func DeleteDvrById(id int) bool
- func DeleteDvrByIpAddr(ipAddr string) bool
- func DeleteDvrByName(name string) bool
- func NewDb()
- func UpdateDvrIpAddr(ipAddr string, newIpAddr string) bool
- func UpdateDvrLastAliveTime(name string) bool
- func UpdateDvrName(name string, newName string) bool
- func UpdateDvrStatusById(id int, status int) bool
- func UpdateDvrStatusByIpAddr(ipAddr string, status int) bool
- func UpdateDvrStatusByName(name string, status int) bool
- type Dvr
Constants ¶
View Source
const ( Alive = 1 Dead = 2 )
View Source
const DATABASE = "../database/new.db"
Variables ¶
This section is empty.
Functions ¶
func DeleteDvrById ¶
func DeleteDvrByIpAddr ¶
func DeleteDvrByName ¶
func UpdateDvrIpAddr ¶
func UpdateDvrLastAliveTime ¶
func UpdateDvrName ¶
func UpdateDvrStatusById ¶
func UpdateDvrStatusByIpAddr ¶
func UpdateDvrStatusByName ¶
Types ¶
type Dvr ¶
type Dvr struct { Uid int `orm:"pk;auto"` Name string `orm:"size(160);unique"` IpAddress string `orm:"size(20);unique"` Version string `orm:"size(160)"` Status int CreationTime time.Time `orm:"auto_now_add;type(datetime)"` LastAlive time.Time `orm:"auto_now_add;type(datetime)"` }
func GetAliveDvr ¶
func GetDvrById ¶
func GetDvrByIpAddr ¶
func GetDvrByName ¶
Click to show internal directories.
Click to hide internal directories.