Files
opencloud/pkg/proxy/option.go
Jörn Friedrich Dreyer 2aba428eb1 add apachevhost option, fix logging defaults
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2020-03-06 16:47:26 +01:00

41 lines
773 B
Go

package proxy
import (
"github.com/owncloud/ocis-pkg/v2/log"
"github.com/owncloud/ocis-proxy/pkg/config"
)
// Option defines a single option function.
type Option func(o *Options)
// Options defines the available options for this package.
type Options struct {
Logger log.Logger
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
}
}
// Config provides a function to set the config option.
func Config(val *config.Config) Option {
return func(o *Options) {
o.Config = val
}
}