fix program flags
This commit is contained in:
@@ -3,6 +3,7 @@ package grpc
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis-pkg/v2/log"
|
||||
"github.com/owncloud/ocis-thumbnails/pkg/config"
|
||||
"github.com/owncloud/ocis-thumbnails/pkg/metrics"
|
||||
@@ -20,6 +21,7 @@ type Options struct {
|
||||
Config *config.Config
|
||||
Metrics *metrics.Metrics
|
||||
Namespace string
|
||||
Flags []cli.Flag
|
||||
}
|
||||
|
||||
// newOptions initializes the available default options.
|
||||
@@ -81,3 +83,10 @@ func Namespace(val string) Option {
|
||||
o.Namespace = val
|
||||
}
|
||||
}
|
||||
|
||||
// Flags provides a function to set the flags option.
|
||||
func Flags(flags []cli.Flag) Option {
|
||||
return func(o *Options) {
|
||||
o.Flags = append(o.Flags, flags...)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ func NewService(opts ...Option) grpc.Service {
|
||||
grpc.Version(version.String),
|
||||
grpc.Address(options.Address),
|
||||
grpc.Context(options.Context),
|
||||
grpc.Flags(options.Flags...),
|
||||
)
|
||||
|
||||
var thumbnail proto.ThumbnailServiceHandler
|
||||
|
||||
Reference in New Issue
Block a user