NewOptions creates a new Options struct with the given options.
(opts ...ExecuteOptionFn)
| 14 | |
| 15 | // NewOptions creates a new Options struct with the given options. |
| 16 | func NewOptions(opts ...ExecuteOptionFn) *Options { |
| 17 | o := &Options{ |
| 18 | Funcs: DefaultFuncCollection, |
| 19 | Vars: map[string]*model.Value{}, |
| 20 | } |
| 21 | for _, opt := range opts { |
| 22 | if opt == nil { |
| 23 | continue |
| 24 | } |
| 25 | opt(o) |
| 26 | } |
| 27 | return o |
| 28 | } |
| 29 | |
| 30 | // WithFuncs sets the functions that can be used in the selector. |
| 31 | func WithFuncs(fc FuncCollection) ExecuteOptionFn { |
no outgoing calls