Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListHandler ¶ added in v1.0.0
ListHandler is configure to handler the `listRoute` url requests and will report a GHSResponse.
- Connects to sql db via `apiDbPath`
- Gets result data dependant on the `archived` and `team` get parameters
- Generates compliance counters for the data set and overall
- Finds the run date of the report
Sample urls:
- /v1/github-standards/
- /v1/github-standards/?archived=false
- /v1/github-standards/?archived=false&team=<team>
Types ¶
type CountValues ¶ added in v1.0.0
type CountValues struct { Count int `json:"count"` CompliantBaseline int `json:"compliant_baseline"` CompliantExtended int `json:"compliant_extended"` }
CountValues covers the counters we want to return for the github standards data
type Counters ¶ added in v1.0.0
type Counters struct { Totals *CountValues `json:"totals"` This *CountValues `json:"current"` }
Counters covers Total and This data where Total is for the overal database and This is for the current query
type GHSResponse ¶ added in v1.0.0
type GHSResponse struct { *response.Response Counters *Counters `json:"counters,omitempty"` QueryFilters map[string]interface{} `json:"query_filters,omitempty"` Result []ghs.GithubStandard `json:"result"` }
GHSResponse uses base response and adds additional data to capture counters, passed query filters and the result data
func NewResponse ¶ added in v1.0.0
func NewResponse() *GHSResponse
Click to show internal directories.
Click to hide internal directories.