-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
38 lines (31 loc) · 1.26 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package database
import "github.com/JIexa24/chef-webapi/database/interfaces"
// CreateAppModule creates module with given parameters.
func (db *DBConnector) CreateAppModule(name, comment string,
initialStatus bool) (*interfaces.AppModuleEntry, error) {
return db.Database.CreateAppModule(name, comment, initialStatus)
}
// GetAllAppModules return all modules.
func (db *DBConnector) GetAllAppModules() ([]interfaces.AppModuleEntry, error) {
return db.Database.GetAllAppModules()
}
// GetAppModuleByID return module by given id.
func (db *DBConnector) GetAppModuleByID(id string) (*interfaces.AppModuleEntry, error) {
return db.Database.GetAppModuleByID(id)
}
// GetAppModuleByName return module by given name.
func (db *DBConnector) GetAppModuleByName(name string) (*interfaces.AppModuleEntry, error) {
return db.Database.GetAppModuleByName(name)
}
// UpdateAppModuleByID update module by given id.
func (db *DBConnector) UpdateAppModuleByID(id string, entry *interfaces.AppModuleEntry) error {
return db.Database.UpdateAppModuleByID(id, entry)
}
// CreateAppModules creates app modules.
func (db *DBConnector) CreateAppModules() error {
if _, err := db.Database.CreateAppModule("ChefWorker",
"Is chef worker processing tasks", false); err != nil {
return err
}
return nil
}