2023-08-27 18:02:51 +02:00
|
|
|
package bolt
|
|
|
|
|
2023-08-29 00:51:04 +02:00
|
|
|
import (
|
|
|
|
"github.com/ansible-semaphore/semaphore/db"
|
|
|
|
"github.com/ansible-semaphore/semaphore/util"
|
|
|
|
)
|
2023-08-27 18:02:51 +02:00
|
|
|
|
|
|
|
func (d *BoltDb) GetRunner(projectID int, runnerID int) (runner db.Runner, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) GetRunners(projectID int) (runners []db.Runner, err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) DeleteRunner(projectID int, runnerID int) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) GetGlobalRunner(runnerID int) (runner db.Runner, err error) {
|
2023-09-11 01:02:10 +02:00
|
|
|
err = d.getObject(0, db.GlobalRunnerProps, intObjectID(runnerID), &runner)
|
2023-08-29 00:51:04 +02:00
|
|
|
|
2023-08-27 18:02:51 +02:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) GetGlobalRunners() (runners []db.Runner, err error) {
|
2023-09-11 01:02:10 +02:00
|
|
|
err = d.getObjects(0, db.GlobalRunnerProps, db.RetrieveQueryParams{}, nil, &runners)
|
2023-08-27 18:02:51 +02:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) DeleteGlobalRunner(runnerID int) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) UpdateRunner(runner db.Runner) (err error) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *BoltDb) CreateRunner(runner db.Runner) (newRunner db.Runner, err error) {
|
2023-08-29 00:51:04 +02:00
|
|
|
runner.Token = util.RandString(12)
|
|
|
|
|
2023-09-11 01:02:10 +02:00
|
|
|
res, err := d.createObject(0, db.GlobalRunnerProps, runner)
|
2023-08-29 00:51:04 +02:00
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
newRunner = res.(db.Runner)
|
2023-08-27 18:02:51 +02:00
|
|
|
return
|
|
|
|
}
|