Bluemage/go/api/api.go

22 lines
294 B
Go

package api
import (
"sync"
"github.com/stephenafamo/bob"
"github.com/tigorlazuardi/bluemage/go/gen/converter"
)
var convert converter.DeviceConverterImpl
type API struct {
mu sync.Mutex
DB bob.Executor
}
func (api *API) lockf(f func()) {
api.mu.Lock()
defer api.mu.Unlock()
f()
}