2019-06-11 16:23:20 +00:00
|
|
|
package handler_test
|
|
|
|
|
|
|
|
import (
|
2023-03-08 12:03:18 +00:00
|
|
|
"github.com/tus/tusd/v2/pkg/filestore"
|
|
|
|
"github.com/tus/tusd/v2/pkg/handler"
|
|
|
|
"github.com/tus/tusd/v2/pkg/memorylocker"
|
2019-06-11 16:23:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func ExampleNewStoreComposer() {
|
|
|
|
composer := handler.NewStoreComposer()
|
|
|
|
|
|
|
|
fs := filestore.New("./data")
|
|
|
|
fs.UseIn(composer)
|
|
|
|
|
|
|
|
ml := memorylocker.New()
|
|
|
|
ml.UseIn(composer)
|
|
|
|
|
|
|
|
config := handler.Config{
|
|
|
|
StoreComposer: composer,
|
|
|
|
}
|
|
|
|
|
|
|
|
_, _ = handler.NewHandler(config)
|
|
|
|
}
|