This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/main.go

41 lines
790 B
Go

package main
import (
"os"
"github.com/urfave/cli/v2"
log "github.com/sirupsen/logrus"
"reichard.io/imagini/cmd"
"reichard.io/imagini/internal/sessions"
)
var globalSessions *sessions.Manager
type UTCFormatter struct {
log.Formatter
}
func (u UTCFormatter) Format(e *log.Entry) ([]byte, error) {
e.Time = e.Time.UTC()
return u.Formatter.Format(e)
}
func main() {
log.SetFormatter(UTCFormatter{&log.TextFormatter{FullTimestamp: true}})
log.Info("Starging Imagini")
app := &cli.App{
Name: "Imagini",
Usage: "A self hosted photo library.",
Commands: []*cli.Command{
&cmd.CmdServe,
&cmd.CmdDBTest,
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}