Documentation
¶
Index ¶
- func SplitPath(path string, base string) []string
- type CategoryStatistic
- type Gopher
- type Node
- func (n *Node) AddChild(value string, content string, fullPath string) *Node
- func (n *Node) Cleanup()
- func (n *Node) FindChild(value string) *Node
- func (n *Node) FlattenTree(nodes *[]*Node)
- func (n *Node) GetString() string
- func (n *Node) MarshalJSON() ([]byte, error)
- func (n *Node) SetContent(content string) string
- func (n *Node) SetShowContent(show bool)
- func (n *Node) SortChildren() []*Node
- type ReportStatistics
- type RolodexTree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CategoryStatistic ¶
type CategoryStatistic struct {
ID uint `gorm:"primaryKey" json:"-" yaml:"-"`
CreatedAt time.Time `json:"-" yaml:"-"`
UpdatedAt time.Time `json:"-" yaml:"-"`
CategoryName string `json:"categoryName" yaml:"categoryName"`
CategoryId string `json:"categoryId" yaml:"categoryId"`
NumIssues int `json:"numIssues" yaml:"numIssues"`
Score int `json:"score" yaml:"score"`
Warnings int `json:"warnings" yaml:"warnings"`
Errors int `json:"errors" yaml:"errors"`
Info int `json:"info" yaml:"info"`
Hints int `json:"hints" yaml:"hints"`
}
CategoryStatistic represents the number of issues for a particular category
type Gopher ¶
type Gopher struct {
DrDocument *model.DrDocument
// contains filtered or unexported fields
}
func NewGopher ¶
func NewGopher(drDoc *model.DrDocument) *Gopher
func (*Gopher) CreateRolodexTree ¶
func (g *Gopher) CreateRolodexTree() *RolodexTree
type Node ¶
type Node struct {
Children map[string]*Node
FullPath string
IsRoot bool
Parent *Node
StringValue string
Id string
NumericId int
IsOpenApi bool
IsFile bool
Index *index.SpecIndex
Statistics *ReportStatistics
// contains filtered or unexported fields
}
func (*Node) FlattenTree ¶
FlattenTree recursively collects all nodes into a flat slice
func (*Node) MarshalJSON ¶
func (*Node) SetContent ¶
func (*Node) SetShowContent ¶
func (*Node) SortChildren ¶
SortChildren returns a slice of child nodes sorted by StringValue alphabetically
type ReportStatistics ¶
type ReportStatistics struct {
ID uint `gorm:"primaryKey" json:"-" yaml:"-"`
CreatedAt time.Time `json:"-" yaml:"-"`
UpdatedAt time.Time `json:"-" yaml:"-"`
FilesizeKB int `json:"filesizeKb,omitempty" yaml:"filesizeKb,omitempty"`
FilesizeBytes int `json:"filesizeBytes,omitempty" yaml:"filesizeBytes,omitempty"`
SpecType string `json:"specType,omitempty" yaml:"specType,omitempty"`
SpecFormat string `json:"specFormat,omitempty" yaml:"specFormat,omitempty"`
Version string `json:"version,omitempty" yaml:"version,omitempty"`
References int `json:"references,omitempty" yaml:"references,omitempty"`
ExternalDocs int `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
Schemas int `json:"schemas,omitempty" yaml:"schemas,omitempty"`
Parameters int `json:"parameters,omitempty" yaml:"parameters,omitempty"`
Links int `json:"links,omitempty" yaml:"links,omitempty"`
Paths int `json:"paths,omitempty" yaml:"paths,omitempty"`
Operations int `json:"operations,omitempty" yaml:"operations,omitempty"`
Tags int `json:"tags,omitempty" yaml:"tags,omitempty"`
Examples int `json:"examples,omitempty" yaml:"examples,omitempty"`
Enums int `json:"enums,omitempty" yaml:"enums,omitempty"`
Security int `json:"security,omitempty" yaml:"security,omitempty"`
OverallScore int `json:"overallScore,omitempty" yaml:"overallScore,omitempty"`
TotalErrors int `json:"totalErrors,omitempty" yaml:"totalErrors,omitempty"`
TotalWarnings int `json:"totalWarnings,omitempty" yaml:"totalWarnings,omitempty"`
TotalInfo int `json:"totalInfo,omitempty" yaml:"totalInfo,omitempty"`
TotalHints int `json:"totalHints,omitempty" yaml:"totalHints,omitempty"`
CategoryStatistics []*CategoryStatistic `gorm:"foreignKey:ID" json:"categoryStatistics,omitempty" yaml:"categoryStatistics,omitempty"`
}
ReportStatistics represents statistics for an individual specification report.
type RolodexTree ¶
type RolodexTree struct {
Root *Node
Children []*Node
Rolodex *index.Rolodex
// contains filtered or unexported fields
}
func NewRolodexTree ¶
func NewRolodexTree(rolodex *index.Rolodex) *RolodexTree
func (*RolodexTree) BuildTree ¶
func (rt *RolodexTree) BuildTree(base string, baseUrl string) *Node
BuildTree constructs the tree from the given paths
func (*RolodexTree) Cleanup ¶
func (rt *RolodexTree) Cleanup()
func (*RolodexTree) GetRoot ¶
func (rt *RolodexTree) GetRoot() *Node
func (*RolodexTree) SearchForNode ¶
func (rt *RolodexTree) SearchForNode(nodeId string) (*Node, bool)
func (*RolodexTree) SearchForNodeByPath ¶
func (rt *RolodexTree) SearchForNodeByPath(path string) (*Node, bool)
Click to show internal directories.
Click to hide internal directories.