Add example for NewStoreComposer()
This commit is contained in:
parent
77b90ad317
commit
dea20c74f5
|
@ -0,0 +1,27 @@
|
||||||
|
package tusd_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tus/tusd"
|
||||||
|
"github.com/tus/tusd/consullocker"
|
||||||
|
"github.com/tus/tusd/filestore"
|
||||||
|
"github.com/tus/tusd/limitedstore"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ExampleNewStoreComposer() {
|
||||||
|
composer := tusd.NewStoreComposer()
|
||||||
|
|
||||||
|
fs := filestore.New("./data")
|
||||||
|
fs.UseIn(composer)
|
||||||
|
|
||||||
|
cl := consullocker.New(nil)
|
||||||
|
cl.UseIn(composer)
|
||||||
|
|
||||||
|
ls := limitedstore.New(1024*1024*1024, composer.Core, composer.Terminater)
|
||||||
|
ls.UseIn(composer)
|
||||||
|
|
||||||
|
config := tusd.Config{
|
||||||
|
StoreComposer: composer,
|
||||||
|
}
|
||||||
|
|
||||||
|
_, _ = tusd.NewHandler(config)
|
||||||
|
}
|
Loading…
Reference in New Issue