// package main -- пускач для хранилища
package main

import (
	"log"

	"git.p78su.freemyip.com/svi/gostore/internal/service"
	"git.p78su.freemyip.com/svi/gostore/pkg/types"
)

var (
	// Version -- версия тега хранилища
	Version = ""
	// Date -- дата релиза
	Date = ""
	// GoVersion -- версия компилятора
	GoVersion = ""
	serv      types.IService
	err       error
)

func main() {
	log.Printf("gostore/main():\n\tgo\t= %v\n\tvers\t= %v\n\tdate\t= %v\n", GoVersion, Version, Date)
	if serv == nil {
		serv, err = service.NewService()
		if err != nil {
			log.Printf("main(): in create IService, err=\n\t%v\n", err)
			return
		}
	}
	run(serv)
	log.Printf("main(): end\n")
}

func run(serv types.IService) {
	serv.Run()
}
