MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Documentation

Method Documentation

common/decls/decls.go:91–108  ·  view source on GitHub ↗

Documentation generates documentation about the Function and its overloads as a common.Doc object.

()

Source from the content-addressed store, hash-verified

89
90// Documentation generates documentation about the Function and its overloads as a common.Doc object.
91func (f *FunctionDecl) Documentation() *common.Doc {
92 if f == nil {
93 return nil
94 }
95 children := make([]*common.Doc, len(f.OverloadDecls()))
96 for i, o := range f.OverloadDecls() {
97 var examples []*common.Doc
98 for _, ex := range o.Examples() {
99 examples = append(examples, common.NewExampleDoc(ex))
100 }
101 od := common.NewOverloadDoc(o.ID(), formatSignature(f.Name(), o), examples...)
102 children[i] = od
103 }
104 return common.NewFunctionDoc(
105 f.Name(),
106 f.Description(),
107 children...)
108}
109
110// Name returns the function name in human-readable terms, e.g. 'contains' of 'math.least'
111func (f *FunctionDecl) Name() string {

Callers 1

TestNilFunctionFunction · 0.95

Calls 9

OverloadDeclsMethod · 0.95
NameMethod · 0.95
DescriptionMethod · 0.95
NewExampleDocFunction · 0.92
NewOverloadDocFunction · 0.92
NewFunctionDocFunction · 0.92
formatSignatureFunction · 0.85
ExamplesMethod · 0.80
IDMethod · 0.65

Tested by 1

TestNilFunctionFunction · 0.76