instance

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubsystemOS = iota + 1
	SubsystemAgent
	SubsystemMySQL
	SubsystemMongo
)
View Source
const (
	SubsystemNameOS    = "os"
	SubsystemNameAgent = "agent"
	SubsystemNameMySQL = "mysql"
	SubsystemNameMongo = "mongo"
)

Variables

View Source
var ErrNotFound = errors.New("subsystem not found")

Functions

func GetInstanceId

func GetInstanceId(db *sql.DB, uuid string) (uint, error)

func GetSubsystemById

func GetSubsystemById(id uint) (proto.Subsystem, error)

func GetSubsystemByName

func GetSubsystemByName(name string) (proto.Subsystem, error)

Types

type DbHandler

type DbHandler interface {
	Create(in proto.Instance) (uint, error)
	Get(uuid string) (uint, *proto.Instance, error)
	Update(in proto.Instance) error
	Delete(uuid string) error
}

type MySQLHandler

type MySQLHandler struct {
	// contains filtered or unexported fields
}

func NewMySQLHandler

func NewMySQLHandler(dbm db.Manager) *MySQLHandler

func (*MySQLHandler) Create

func (h *MySQLHandler) Create(in proto.Instance) (uint, error)

func (*MySQLHandler) Delete

func (h *MySQLHandler) Delete(uuid string) error

func (*MySQLHandler) Get

func (h *MySQLHandler) Get(uuid string) (uint, *proto.Instance, error)

func (*MySQLHandler) GetAll

func (h *MySQLHandler) GetAll() ([]proto.Instance, error)

func (*MySQLHandler) GetByName

func (h *MySQLHandler) GetByName(subsystem, name, parentUUID string) (uint, *proto.Instance, error)

func (*MySQLHandler) Update

func (h *MySQLHandler) Update(in proto.Instance) error

Jump to

Keyboard shortcuts

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