4bd0ca4ac6
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
37 lines
730 B
Go
37 lines
730 B
Go
package service
|
|
|
|
import (
|
|
"github.com/photoprism/photoprism/internal/classify"
|
|
"github.com/photoprism/photoprism/internal/config"
|
|
"github.com/photoprism/photoprism/internal/nsfw"
|
|
"github.com/photoprism/photoprism/internal/photoprism"
|
|
"github.com/photoprism/photoprism/internal/session"
|
|
)
|
|
|
|
var conf *config.Config
|
|
|
|
var services struct {
|
|
Import *photoprism.Import
|
|
Index *photoprism.Index
|
|
Nsfw *nsfw.Detector
|
|
Convert *photoprism.Convert
|
|
Resample *photoprism.Resample
|
|
Classify *classify.TensorFlow
|
|
Session *session.Session
|
|
}
|
|
|
|
func SetConfig(c *config.Config) {
|
|
if c == nil {
|
|
panic("config is nil")
|
|
}
|
|
|
|
conf = c
|
|
}
|
|
|
|
func Config() *config.Config {
|
|
if conf == nil {
|
|
panic("config is nil")
|
|
}
|
|
|
|
return conf
|
|
}
|