Validate validates the context-variable configuration is well-formed.
()
| 328 | |
| 329 | // Validate validates the context-variable configuration is well-formed. |
| 330 | func (ctx *ContextVariable) Validate() error { |
| 331 | if ctx == nil { |
| 332 | return nil |
| 333 | } |
| 334 | if ctx.TypeName == "" { |
| 335 | return errors.New("invalid context variable: missing type name") |
| 336 | } |
| 337 | return nil |
| 338 | } |
| 339 | |
| 340 | // NewFunction creates a serializable function and overload set. |
| 341 | func NewFunction(name string, overloads ...*Overload) *Function { |