github_standards

package
v1.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListHandler added in v1.0.0

func ListHandler(server *api.ApiServer, w http.ResponseWriter, r *http.Request)

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>

func Register

func Register(mux *http.ServeMux, apiServer *api.ApiServer)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL