added flag options
This commit is contained in:
@@ -3,6 +3,7 @@ package http
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/cli"
|
||||
"github.com/owncloud/ocis-konnectd/pkg/config"
|
||||
"github.com/owncloud/ocis-konnectd/pkg/metrics"
|
||||
"github.com/owncloud/ocis-pkg/log"
|
||||
@@ -17,6 +18,7 @@ type Options struct {
|
||||
Context context.Context
|
||||
Config *config.Config
|
||||
Metrics *metrics.Metrics
|
||||
Flags []cli.Flag
|
||||
}
|
||||
|
||||
// newOptions initializes the available default options.
|
||||
@@ -57,3 +59,10 @@ func Metrics(val *metrics.Metrics) Option {
|
||||
o.Metrics = val
|
||||
}
|
||||
}
|
||||
|
||||
// Flags provides a function to set the flags option.
|
||||
func Flags(val []cli.Flag) Option {
|
||||
return func(o *Options) {
|
||||
o.Flags = append(o.Flags, val...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user