File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ package spectrum
2+
3+ type SpecMeta struct {
4+ Counts SpecMetaCounts
5+ Names SpecMetaNames
6+ }
7+
8+ func NewSpecMeta () * SpecMeta {
9+ return & SpecMeta {
10+ Counts : SpecMetaCounts {},
11+ Names : SpecMetaNames {}}
12+ }
13+
14+ func (m * SpecMeta ) Inflate () {
15+ m .Counts = m .Names .Counts ()
16+ }
17+
18+ type SpecMetaCounts struct {
19+ Endpoints int
20+ Paths int
21+ Models int
22+ }
23+
24+ type SpecMetaNames struct {
25+ Endpoints []string
26+ Models []string
27+ Paths []string
28+ }
29+
30+ func (n SpecMetaNames ) Counts () SpecMetaCounts {
31+ return SpecMetaCounts {
32+ Endpoints : len (n .Endpoints ),
33+ Models : len (n .Models ),
34+ Paths : len (n .Paths ),
35+ }
36+ }
37+
38+ type SpecMetaSet struct {
39+ Data map [string ]SpecMeta
40+ }
41+
42+ func NewSpecMetaSet () * SpecMetaSet {
43+ return & SpecMetaSet {Data : map [string ]SpecMeta {}}
44+ }
You can’t perform that action at this time.
0 commit comments