models

package
v0.0.0-...-8cb1887 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2014 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTAINER_MISS    = 0
	CONTAINER_START   = 1
	CONTAINER_STOP    = 2
	CONTAINER_PAUSE   = 3
	CONTAINER_UNPAUSE = 4
	CONTAINER_DIE     = 5
	CONTAINER_RESTART = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerStatusBinding

type ContainerStatusBinding struct {
	HostIp        string
	ContainerName string
	Status        string
}

type HostInfoBinding

type HostInfoBinding struct {
	Client     *docker.Client
	Containers []*docker.Container
	Listener   chan *docker.APIEvents
	SyncMutex  *sync.Mutex
	Status     bool
}

type HostModel

type HostModel struct {
	Id       bson.ObjectId "_id"
	HostIp   string
	SensorId string
	HostType string
	ParentId string
}

func HostByHostIp

func HostByHostIp(db *mgo.Collection, hostip string) (HostModel, error)

func HostBySensorId

func HostBySensorId(db *mgo.Collection, sensorid string) (HostModel, error)

func Hosts

func Hosts(db *mgo.Collection) ([]HostModel, error)

controller provider for controller

func HostsByConditions

func HostsByConditions(db *mgo.Collection, conditions map[string]interface{}) ([]HostModel, error)

func (*HostModel) Delete

func (this *HostModel) Delete(db *mgo.Collection) error

func (*HostModel) Save

func (this *HostModel) Save(db *mgo.Collection) error

db basic CURD

func (*HostModel) Update

func (this *HostModel) Update(db *mgo.Collection) error

Jump to

Keyboard shortcuts

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