db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainersTableName        = "containers"
	NetworkInterfacesTableName = "network_interfaces"
	NetworkStatsTableName      = "network_stats"
	NodeTableName              = "node_stats"
	DBDrivers                  = "elasticsearch"
)
View Source
const DEFAULT_DB = "elasticsearch"

Variables

This section is empty.

Functions

func InitDb

func InitDb(dbType, indexName, configPath string) error

func InitElasticDb

func InitElasticDb(indexName, configPath string) error

func IsValidDBDriver

func IsValidDBDriver(dbDriver string) bool

Types

type Db

type Db interface {
	Close()
	UpdateNode(*uc.Node) error
	CreateNode(*uc.Node) error
	CreateCluster() error
}

func NewConn

func NewConn(indexName, configPath string) (Db, error)

func NewConnOf

func NewConnOf(dbType string, indexName string, configPath string) (Db, error)

type EContainer

type EContainer struct {
	IsActive  bool
	DockerID  string
	Name      string
	NodeName  string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type ENetworkInterface

type ENetworkInterface struct {
	Name string
}

type ENetworkStat

type ENetworkStat struct {
	Value                int64
	Name                 string
	ContainerDockerID    string
	ContainerName        string
	NodeName             string
	NetworkInterfaceName string
	UpdatedAt            time.Time
}

type ENode

type ENode struct {
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type LogConn added in v0.1.0

type LogConn struct {
	*elastic.Client
	// contains filtered or unexported fields
}

func NewConnTo added in v0.1.0

func NewConnTo(elasticIP, elasticPort, logstashIP, logstashPort, indexName, configPath string) (LogConn, error)

func NewElasticConn

func NewElasticConn(indexName string, configPath string) (LogConn, error)

func (LogConn) Close added in v0.1.0

func (c LogConn) Close()

func (LogConn) CreateCluster added in v0.1.0

func (c LogConn) CreateCluster() error

func (LogConn) CreateNode added in v0.1.0

func (c LogConn) CreateNode(node *uc.Node) error

func (LogConn) UpdateNode added in v0.1.0

func (c LogConn) UpdateNode(node *uc.Node) error

Jump to

Keyboard shortcuts

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