Files

52 lines
1018 B
Go
Raw Permalink Normal View History

2020-07-29 11:02:03 +02:00
package debug
import (
2024-10-10 11:57:59 +02:00
"context"
2022-05-04 14:49:59 +02:00
"github.com/owncloud/ocis/v2/ocis-pkg/log"
2022-06-20 16:49:06 +02:00
"github.com/owncloud/ocis/v2/services/thumbnails/pkg/config"
2020-07-29 11:02:03 +02:00
)
// Option defines a single option function.
type Option func(o *Options)
// Options defines the available options for this package.
type Options struct {
Name string
Address string
Logger log.Logger
2024-10-10 11:57:59 +02:00
Context context.Context
2020-07-29 11:02:03 +02:00
Config *config.Config
}
// newOptions initializes the available default options.
func newOptions(opts ...Option) Options {
opt := Options{}
for _, o := range opts {
o(&opt)
}
return opt
}
// Logger provides a function to set the logger option.
func Logger(val log.Logger) Option {
return func(o *Options) {
o.Logger = val
}
}
2024-10-10 11:57:59 +02:00
// Context provides a function to set the context option.
func Context(val context.Context) Option {
return func(o *Options) {
o.Context = val
}
}
2020-07-29 11:02:03 +02:00
// Config provides a function to set the config option.
func Config(val *config.Config) Option {
return func(o *Options) {
o.Config = val
}
}