Files
cloud-services/services/optimus/services/dbc.go

20 lines
431 B
Go

package services
import (
"sync"
"github.com/fiskerinc/cloud-services/pkg/dbc"
"github.com/fiskerinc/cloud-services/pkg/dbc/models"
)
var collection models.DBCCollectionInterface
var collectionOnce sync.Once
// GetDBCCollection returns singleton instance of collection of DBCs
func GetDBCCollection() models.DBCCollectionInterface {
collectionOnce.Do(func() {
collection = dbc.NewDBCCollection()
})
return collection
}