store/file: add WithDir option (#2038)
This commit is contained in:
16
store/file/options.go
Normal file
16
store/file/options.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package file
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/go-micro/v3/store"
|
||||
)
|
||||
|
||||
type dirKey struct{}
|
||||
|
||||
// WithDir sets the directory to store the files in
|
||||
func WithDir(dir string) store.Option {
|
||||
return func(o *store.Options) {
|
||||
o.Context = context.WithValue(o.Context, dirKey{}, dir)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user