models

package
v0.0.0-...-a0e0d51 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2014 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDevice

func AddDevice(device *Device) error

func InitDb

func InitDb(c *config.Config) (dbmap *gorp.DbMap, err error)

func UpdateDeviceStatus

func UpdateDeviceStatus(device *Device, status string) (err error)

Types

type Device

type Device struct {
	Id        int64
	Name      string `form:"name" binding:"required" json:"name"`
	Type      string `form:"type" binding:"required" json:"type"`
	OS        string `form:"os" binding:"required" json:"os"`
	OsVersion string `form:"os_version" json:"os_version" binding:"required"`
	Status    string
}

func GetAllDevices

func GetAllDevices() (devices []Device, err error)

func GetDevice

func GetDevice(id int64) (device *Device, err error)

func GetDeviceWithName

func GetDeviceWithName(name string) (*Device, error)

func (*Device) PreInsert

func (d *Device) PreInsert(s gorp.SqlExecutor) error

func (Device) Validate

func (d Device) Validate(errs binding.Errors, req *http.Request) binding.Errors

Jump to

Keyboard shortcuts

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