Debian Codegraph @

api/v1/lib/executor/options.go

raw symbols SCIP
1 package executor
2
3 // A CallOpt is a functional option type for Calls.
4 type CallOpt func(*Call)
5
6 // With applies the given CallOpts to the receiving Call, returning it.
7 func (c *Call) With(opts ...CallOpt) *Call {
8 for _, opt := range opts {
9 opt(c)
10 }
11 return c
12 }
13
14 type CallOptions []CallOpt
15
16 // Copy returns a cloned copy of CallOptions
17 func (co CallOptions) Copy() CallOptions {
18 if len(co) == 0 {
19 return nil
20 }
21 x := make(CallOptions, len(co))
22 copy(x, co)
23 return x
24 }