Documentation
¶
Index ¶
- Constants
- func ConvertBoolToInt(val bool) int
- func ConvertIntToBool(val int) bool
- func ConvertStrBoolIntToBool(val string) bool
- func ConvertStringToBool(val string) bool
- func ExecuteSQLStmt(dbCmd string, dbHdl *sql.DB) (driver.Result, error)
- type DBIntf
- type DBNotConnectedError
- type DBUtil
- func (db *DBUtil) CompareObjectDefaultAndDiff(obj objects.ConfigObj, inObj objects.ConfigObj) ([]bool, error)
- func (db *DBUtil) CompareObjectsAndDiff(obj objects.ConfigObj, updateKeys map[string]bool, inObj objects.ConfigObj) ([]bool, error)
- func (db *DBUtil) Connect() error
- func (db *DBUtil) DeleteObjectFromDb(obj objects.ConfigObj) error
- func (db *DBUtil) DeleteObjectWithKeyFromDb(key interface{}) error
- func (db *DBUtil) DeleteUUIDToObjKeyMap(uuid, objKey string) error
- func (db *DBUtil) DeleteValFromDb(key interface{}) error
- func (db *DBUtil) Disconnect()
- func (db *DBUtil) GetAllEventObjFromDb(obj events.EventObj) ([]events.EventObj, error)
- func (db *DBUtil) GetAllKeys(pattern interface{}) (val interface{}, err error)
- func (db *DBUtil) GetAllObjFromDb(obj objects.ConfigObj) ([]objects.ConfigObj, error)
- func (db *DBUtil) GetBulkObjFromDb(obj objects.ConfigObj, startIndex, count int64) (error, int64, int64, bool, []objects.ConfigObj)
- func (db *DBUtil) GetEventObjectFromDb(obj events.EventObj, objKey string) (events.EventObj, error)
- func (db *DBUtil) GetKey(obj objects.ConfigObj) string
- func (db *DBUtil) GetObjKeyFromUUID(uuid string) (string, error)
- func (db *DBUtil) GetObjectFromDb(obj objects.ConfigObj, objKey string) (objects.ConfigObj, error)
- func (db *DBUtil) GetUUIDFromObjKey(objKey string) (string, error)
- func (db *DBUtil) GetValFromDB(key interface{}, field interface{}) (val interface{}, err error)
- func (db *DBUtil) MergeDbAndConfigObj(obj, dbObj objects.ConfigObj, attrSet []bool) (objects.ConfigObj, error)
- func (db *DBUtil) MergeDbAndConfigObjForPatchUpdate(obj, dbObj objects.ConfigObj, patchInfo []objects.PatchOpInfo) (objects.ConfigObj, []bool, error)
- func (db *DBUtil) MergeDbObjKeys(obj, dbObj objects.ConfigObj) (objects.ConfigObj, error)
- func (db *DBUtil) Publish(op string, channel interface{}, msg interface{})
- func (db *DBUtil) StoreEventObjectInDb(obj events.EventObj) error
- func (db *DBUtil) StoreObjectDefaultInDb(obj objects.ConfigObj) error
- func (db *DBUtil) StoreObjectInDb(obj objects.ConfigObj) error
- func (db *DBUtil) StoreUUIDToObjKeyMap(objKey string) (string, error)
- func (db *DBUtil) StoreValInDb(key interface{}, val interface{}, field interface{}) error
- func (db *DBUtil) UpdateObjectInDb(obj, inObj objects.ConfigObj, attrSet []bool) error
Constants ¶
View Source
const ( DB_CONNECT_TIME_INTERVAL = 2 DB_CONNECT_RETRY_LOG_COUNT = 100 )
Variables ¶
This section is empty.
Functions ¶
func ConvertBoolToInt ¶
func ConvertIntToBool ¶
func ConvertStrBoolIntToBool ¶
func ConvertStringToBool ¶
Types ¶
type DBIntf ¶
type DBIntf interface {
Connect() error
Disconnect()
StoreObjectInDb(objects.ConfigObj) error
StoreObjectDefaultInDb(objects.ConfigObj) error
DeleteObjectFromDb(objects.ConfigObj) error
GetObjectFromDb(objects.ConfigObj, string) (objects.ConfigObj, error)
GetKey(objects.ConfigObj) string
GetAllObjFromDb(objects.ConfigObj) ([]objects.ConfigObj, error)
CompareObjectsAndDiff(objects.ConfigObj, map[string]bool, objects.ConfigObj) ([]bool, error)
CompareObjectDefaultAndDiff(objects.ConfigObj, objects.ConfigObj) ([]bool, error)
UpdateObjectInDb(objects.ConfigObj, objects.ConfigObj, []bool) error
MergeDbAndConfigObj(objects.ConfigObj, objects.ConfigObj, []bool) (objects.ConfigObj, error)
GetBulkObjFromDb(obj objects.ConfigObj, startIndex, count int64) (error, int64, int64, bool, []objects.ConfigObj)
Publish(string, interface{}, interface{})
StoreValInDb(interface{}, interface{}, interface{}) error
DeleteValFromDb(interface{}) error
GetAllKeys(interface{}) (interface{}, error)
GetValFromDB(key interface{}, field interface{}) (val interface{}, err error)
StoreEventObjectInDb(events.EventObj) error
GetEventObjectFromDb(events.EventObj, string) (events.EventObj, error)
GetAllEventObjFromDb(events.EventObj) ([]events.EventObj, error)
MergeDbAndConfigObjForPatchUpdate(objects.ConfigObj, objects.ConfigObj, []objects.PatchOpInfo) (objects.ConfigObj, []bool, error)
StoreUUIDToObjKeyMap(objKey string) (string, error)
DeleteUUIDToObjKeyMap(uuid, objKey string) error
GetUUIDFromObjKey(objKey string) (string, error)
GetObjKeyFromUUID(uuid string) (string, error)
MergeDbObjKeys(obj, dbObj objects.ConfigObj) (objects.ConfigObj, error)
}
type DBNotConnectedError ¶
type DBNotConnectedError struct {
// contains filtered or unexported fields
}
func (DBNotConnectedError) Error ¶
func (e DBNotConnectedError) Error() string
type DBUtil ¶
func NewDBUtil ¶
func NewDBUtil(logger logging.LoggerIntf) *DBUtil
func (*DBUtil) CompareObjectDefaultAndDiff ¶
func (*DBUtil) CompareObjectsAndDiff ¶
func (*DBUtil) DeleteObjectFromDb ¶
func (*DBUtil) DeleteObjectWithKeyFromDb ¶
func (*DBUtil) DeleteUUIDToObjKeyMap ¶
func (*DBUtil) DeleteValFromDb ¶
func (*DBUtil) Disconnect ¶
func (db *DBUtil) Disconnect()
func (*DBUtil) GetAllEventObjFromDb ¶
func (*DBUtil) GetAllKeys ¶
func (*DBUtil) GetAllObjFromDb ¶
func (*DBUtil) GetBulkObjFromDb ¶
func (*DBUtil) GetEventObjectFromDb ¶
func (*DBUtil) GetObjectFromDb ¶
func (*DBUtil) GetUUIDFromObjKey ¶
func (*DBUtil) GetValFromDB ¶
func (*DBUtil) MergeDbAndConfigObj ¶
func (*DBUtil) MergeDbAndConfigObjForPatchUpdate ¶
func (*DBUtil) MergeDbObjKeys ¶
func (*DBUtil) StoreEventObjectInDb ¶
func (*DBUtil) StoreObjectDefaultInDb ¶
func (*DBUtil) StoreUUIDToObjKeyMap ¶
func (*DBUtil) StoreValInDb ¶
Click to show internal directories.
Click to hide internal directories.