portal/shared/shared.go

54 lines
828 B
Go
Raw Normal View History

package shared
import (
"github.com/golang-queue/queue"
"github.com/tus/tusd/pkg/filestore"
tusd "github.com/tus/tusd/pkg/handler"
2023-05-17 17:34:44 +00:00
"go.uber.org/zap"
_ "go.uber.org/zap"
"log"
)
var tusQueue *queue.Queue
var tusStore *filestore.FileStore
var tusComposer *tusd.StoreComposer
2023-05-17 17:34:44 +00:00
var logger *zap.Logger
func SetTusQueue(q *queue.Queue) {
tusQueue = q
}
func GetTusQueue() *queue.Queue {
return tusQueue
}
func SetTusStore(s *filestore.FileStore) {
tusStore = s
}
func GetTusStore() *filestore.FileStore {
return tusStore
}
func SetTusComposer(c *tusd.StoreComposer) {
tusComposer = c
}
func GetTusComposer() *tusd.StoreComposer {
return tusComposer
}
2023-05-17 17:34:44 +00:00
func Init() {
newLogger, err := zap.NewProduction()
if err != nil {
log.Fatal(err)
}
logger = newLogger
}
func GetLogger() *zap.Logger {
return logger
}