24 lines
362 B
Go
24 lines
362 B
Go
package api
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/go-jet/jet/v2/qrm"
|
|
"github.com/stephenafamo/bob"
|
|
"github.com/tigorlazuardi/bluemage/go/gen/converter"
|
|
)
|
|
|
|
var convert converter.DeviceConverterImpl
|
|
|
|
type API struct {
|
|
mu sync.Mutex
|
|
Executor bob.Executor
|
|
DB qrm.Queryable
|
|
}
|
|
|
|
func (api *API) lockf(f func()) {
|
|
api.mu.Lock()
|
|
defer api.mu.Unlock()
|
|
f()
|
|
}
|