dvrDbOps

package
v0.0.0-...-ece7421 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package dvrDbOps provides database interactions for dvr database Includes basic CRUD functions as well as initializing the database upon init

Index

Constants

View Source
const (
	Alive = 1
	Dead  = 2
)
View Source
const DATABASE = "../database/new.db"

Variables

This section is empty.

Functions

func AddNewDvr

func AddNewDvr(newDvr *Dvr) bool

func DeleteDvrById

func DeleteDvrById(id int) bool

func DeleteDvrByIpAddr

func DeleteDvrByIpAddr(ipAddr string) bool

func DeleteDvrByName

func DeleteDvrByName(name string) bool

func NewDb

func NewDb()

func UpdateDvrIpAddr

func UpdateDvrIpAddr(ipAddr string, newIpAddr string) bool

func UpdateDvrLastAliveTime

func UpdateDvrLastAliveTime(name string) bool

func UpdateDvrName

func UpdateDvrName(name string, newName string) bool

func UpdateDvrStatusById

func UpdateDvrStatusById(id int, status int) bool

func UpdateDvrStatusByIpAddr

func UpdateDvrStatusByIpAddr(ipAddr string, status int) bool

func UpdateDvrStatusByName

func UpdateDvrStatusByName(name string, status int) bool

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 GetAliveDvr() ([]*Dvr, int64)

func GetAllDvr

func GetAllDvr() ([]*Dvr, int64)

func GetDvrById

func GetDvrById(id int) *Dvr

func GetDvrByIpAddr

func GetDvrByIpAddr(ipAddr string) *Dvr

func GetDvrByName

func GetDvrByName(name string) *Dvr

Jump to

Keyboard shortcuts

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