evcc-io/server/db/registry.go

18 lines
226 B
Go

package db
import (
"sync"
"gorm.io/gorm"
)
var (
mu sync.Mutex
registry []func(db *gorm.DB) error
)
func Register(fun func(db *gorm.DB) error) {
mu.Lock()
defer mu.Unlock()
registry = append(registry, fun)
}