Bluemage/go/api/api.go
2024-08-05 23:06:32 +07:00

19 lines
197 B
Go

package api
import (
"sync"
"github.com/stephenafamo/bob"
)
type API struct {
mu sync.Mutex
db bob.Executor
}
func (api *API) lockf(f func()) {
api.mu.Lock()
defer api.mu.Unlock()
f()
}