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

Method Documentation

common/decls/decls.go:92–109  ·  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

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