iot_server/internal/pkg/container/cache.go

18 lines
339 B
Go
Raw Permalink Normal View History

2023-08-28 06:49:44 +00:00
package container
import (
"github.com/winc-link/hummingbird/internal/pkg/cache"
"github.com/winc-link/hummingbird/internal/pkg/di"
)
var CacheFuncName = di.TypeInstanceToName((*cache.Cache)(nil))
func CacheFuncFrom(get di.Get) cache.Cache {
client, ok := get(CacheFuncName).(cache.Cache)
if !ok {
return nil
}
return client
}