photoprism/internal/service/service.go
Michael Mayer a91206a509 Universal sidecar configuration, indexing with multiple roots #268 #348
Slowly getting to the point where only very few people are able to maintain this codebase :)

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2020-06-07 10:09:35 +02:00

47 lines
1,019 B
Go

package service
import (
"github.com/allegro/bigcache"
"github.com/photoprism/photoprism/internal/classify"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/event"
"github.com/photoprism/photoprism/internal/nsfw"
"github.com/photoprism/photoprism/internal/photoprism"
"github.com/photoprism/photoprism/internal/query"
"github.com/photoprism/photoprism/internal/session"
)
var log = event.Log
var conf *config.Config
var services struct {
Cache *bigcache.BigCache
Classify *classify.TensorFlow
Convert *photoprism.Convert
Import *photoprism.Import
Index *photoprism.Index
Moments *photoprism.Moments
Purge *photoprism.Purge
Nsfw *nsfw.Detector
Query *query.Query
Resample *photoprism.Resample
Session *session.Session
}
func SetConfig(c *config.Config) {
if c == nil {
panic("config is nil")
}
conf = c
photoprism.SetConfig(c)
}
func Config() *config.Config {
if conf == nil {
panic("config is nil")
}
return conf
}