2016-03-04 21:14:46 +00:00
|
|
|
package tusd_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/tus/tusd"
|
|
|
|
"github.com/tus/tusd/filestore"
|
|
|
|
"github.com/tus/tusd/limitedstore"
|
2016-09-29 23:14:52 +00:00
|
|
|
"github.com/tus/tusd/memorylocker"
|
2016-03-04 21:14:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func ExampleNewStoreComposer() {
|
|
|
|
composer := tusd.NewStoreComposer()
|
|
|
|
|
|
|
|
fs := filestore.New("./data")
|
|
|
|
fs.UseIn(composer)
|
|
|
|
|
2016-09-29 23:14:52 +00:00
|
|
|
ml := memorylocker.New()
|
|
|
|
ml.UseIn(composer)
|
2016-03-04 21:14:46 +00:00
|
|
|
|
|
|
|
ls := limitedstore.New(1024*1024*1024, composer.Core, composer.Terminater)
|
|
|
|
ls.UseIn(composer)
|
|
|
|
|
|
|
|
config := tusd.Config{
|
|
|
|
StoreComposer: composer,
|
|
|
|
}
|
|
|
|
|
|
|
|
_, _ = tusd.NewHandler(config)
|
|
|
|
}
|