edge/pkg/bundle/zim/option.go
William Petit a5c67c29d0
Some checks failed
arcad/edge/pipeline/head There was a failure building this commit
feat(bundle): add zim format support
2023-10-19 22:20:52 +02:00

31 lines
450 B
Go

package zim
import "time"
type Options struct {
URLCacheSize int
URLCacheTTL time.Duration
CacheSize int
}
type OptionFunc func(opts *Options)
func NewOptions(funcs ...OptionFunc) *Options {
funcs = append([]OptionFunc{
WithCacheSize(2048),
}, funcs...)
opts := &Options{}
for _, fn := range funcs {
fn(opts)
}
return opts
}
func WithCacheSize(size int) OptionFunc {
return func(opts *Options) {
opts.CacheSize = size
}
}