MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / APICount

Method APICount

service/api-doc/service.go:75–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75func (d *DocLoader) APICount() int64 {
76 if d.openAPI3Doc == nil || d.openAPI3Doc.Paths == nil {
77 return 0
78 }
79 var count int64
80 for _, item := range d.openAPI3Doc.Paths.Map() {
81 if item.Get != nil {
82 count++
83 }
84 if item.Post != nil {
85 count++
86 }
87 if item.Put != nil {
88 count++
89 }
90 if item.Patch != nil {
91 count++
92 }
93 if item.Delete != nil {
94 count++
95 }
96 if item.Head != nil {
97 count++
98 }
99 if item.Options != nil {
100 count++
101 }
102 if item.Trace != nil {
103 count++
104 }
105 }
106 return count
107}
108
109func (d *DocLoader) AddPrefixInAll(prefix string) error {
110 prefix = strings.TrimSpace(prefix)

Callers 2

UpdateDocMethod · 0.95
CommitDocMethod · 0.95

Calls 1

MapMethod · 0.65

Tested by

no test coverage detected