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

Method Documentation

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

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