Documentation ¶
Index ¶
- Constants
- Variables
- type BoltDB
- func (b *BoltDB) CreateWorkload(w *wltypes.RDTWorkLoad) error
- func (b *BoltDB) DeleteWorkload(w *wltypes.RDTWorkLoad) error
- func (b *BoltDB) GetAllWorkload() ([]wltypes.RDTWorkLoad, error)
- func (b *BoltDB) GetWorkloadByID(id string) (wltypes.RDTWorkLoad, error)
- func (b *BoltDB) GetWorkloadByUUID(id string) (wltypes.RDTWorkLoad, error)
- func (b *BoltDB) Initialize(transport, dbname string) error
- func (b *BoltDB) QueryWorkload(query map[string]interface{}) ([]wltypes.RDTWorkLoad, error)
- func (b *BoltDB) UpdateWorkload(w *wltypes.RDTWorkLoad) error
- func (b *BoltDB) ValidateWorkload(w *wltypes.RDTWorkLoad) error
- type DB
- type MgoDB
- func (m *MgoDB) CreateWorkload(w *wltypes.RDTWorkLoad) error
- func (m *MgoDB) DeleteWorkload(w *wltypes.RDTWorkLoad) error
- func (m *MgoDB) GetAllWorkload() ([]wltypes.RDTWorkLoad, error)
- func (m *MgoDB) GetWorkloadByID(id string) (wltypes.RDTWorkLoad, error)
- func (m *MgoDB) GetWorkloadByUUID(id string) (wltypes.RDTWorkLoad, error)
- func (m *MgoDB) Initialize(transport, dbname string) error
- func (m *MgoDB) QueryWorkload(query map[string]interface{}) ([]wltypes.RDTWorkLoad, error)
- func (m *MgoDB) UpdateWorkload(w *wltypes.RDTWorkLoad) error
- func (m *MgoDB) ValidateWorkload(w *wltypes.RDTWorkLoad) error
Constants ¶
const MappingTableName = "mapping"
MappingTableName contains mapping between UUID and WorkloadID
const WorkloadTableName = "workload"
WorkloadTableName is the table name for workload
Variables ¶
var Dbname string
Dbname is database name of mgodb
Functions ¶
This section is empty.
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
BoltDB connection
func (*BoltDB) CreateWorkload ¶
func (b *BoltDB) CreateWorkload(w *wltypes.RDTWorkLoad) error
CreateWorkload creates workload in db
func (*BoltDB) DeleteWorkload ¶
func (b *BoltDB) DeleteWorkload(w *wltypes.RDTWorkLoad) error
DeleteWorkload removes workload from db
func (*BoltDB) GetAllWorkload ¶
func (b *BoltDB) GetAllWorkload() ([]wltypes.RDTWorkLoad, error)
GetAllWorkload returns all workloads in db
func (*BoltDB) GetWorkloadByID ¶
func (b *BoltDB) GetWorkloadByID(id string) (wltypes.RDTWorkLoad, error)
GetWorkloadByID by ID
func (*BoltDB) GetWorkloadByUUID ¶
func (b *BoltDB) GetWorkloadByUUID(id string) (wltypes.RDTWorkLoad, error)
GetWorkloadByUUID Returns workload specified by UUID (if such exists in DB)
func (*BoltDB) Initialize ¶
Initialize creates two buckets: for storing workloads and UUID-ID mapping
func (*BoltDB) QueryWorkload ¶
func (b *BoltDB) QueryWorkload(query map[string]interface{}) ([]wltypes.RDTWorkLoad, error)
QueryWorkload with given params
func (*BoltDB) UpdateWorkload ¶
func (b *BoltDB) UpdateWorkload(w *wltypes.RDTWorkLoad) error
UpdateWorkload updates
func (*BoltDB) ValidateWorkload ¶
func (b *BoltDB) ValidateWorkload(w *wltypes.RDTWorkLoad) error
ValidateWorkload from data base view
type DB ¶
type DB interface { Initialize(transport, dbname string) error CreateWorkload(w *wltypes.RDTWorkLoad) error DeleteWorkload(w *wltypes.RDTWorkLoad) error UpdateWorkload(w *wltypes.RDTWorkLoad) error GetAllWorkload() ([]wltypes.RDTWorkLoad, error) GetWorkloadByID(id string) (wltypes.RDTWorkLoad, error) GetWorkloadByUUID(id string) (wltypes.RDTWorkLoad, error) ValidateWorkload(w *wltypes.RDTWorkLoad) error QueryWorkload(query map[string]interface{}) ([]wltypes.RDTWorkLoad, error) }
DB is the interface for a db engine
type MgoDB ¶
type MgoDB struct {
// contains filtered or unexported fields
}
MgoDB is connection of mgodb
func (*MgoDB) CreateWorkload ¶
func (m *MgoDB) CreateWorkload(w *wltypes.RDTWorkLoad) error
CreateWorkload creates workload in db
func (*MgoDB) DeleteWorkload ¶
func (m *MgoDB) DeleteWorkload(w *wltypes.RDTWorkLoad) error
DeleteWorkload removes workload from db
func (*MgoDB) GetAllWorkload ¶
func (m *MgoDB) GetAllWorkload() ([]wltypes.RDTWorkLoad, error)
GetAllWorkload returns all workloads in db
func (*MgoDB) GetWorkloadByID ¶
func (m *MgoDB) GetWorkloadByID(id string) (wltypes.RDTWorkLoad, error)
GetWorkloadByID by ID
func (*MgoDB) GetWorkloadByUUID ¶
func (m *MgoDB) GetWorkloadByUUID(id string) (wltypes.RDTWorkLoad, error)
GetWorkloadByUUID Returns workload specified by UUID (if such exists in DB)
func (*MgoDB) Initialize ¶
Initialize does initialize
func (*MgoDB) QueryWorkload ¶
func (m *MgoDB) QueryWorkload(query map[string]interface{}) ([]wltypes.RDTWorkLoad, error)
QueryWorkload with given params
func (*MgoDB) UpdateWorkload ¶
func (m *MgoDB) UpdateWorkload(w *wltypes.RDTWorkLoad) error
UpdateWorkload updates
func (*MgoDB) ValidateWorkload ¶
func (m *MgoDB) ValidateWorkload(w *wltypes.RDTWorkLoad) error
ValidateWorkload from data base view