refactor: move shared global state to a shared package
This commit is contained in:
parent
503cb55c55
commit
2f514c02be
|
@ -0,0 +1,35 @@
|
|||
package shared
|
||||
|
||||
import (
|
||||
"github.com/golang-queue/queue"
|
||||
"github.com/tus/tusd/pkg/filestore"
|
||||
tusd "github.com/tus/tusd/pkg/handler"
|
||||
)
|
||||
|
||||
var tusQueue *queue.Queue
|
||||
var tusStore *filestore.FileStore
|
||||
var tusComposer *tusd.StoreComposer
|
||||
|
||||
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
|
||||
}
|
Loading…
Reference in New Issue