Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheLicense ¶
func SaveCacheListLicenses ¶
func SaveCacheListLicenses(licenses []LicenseSummary) error
Types ¶
type License ¶
type License struct { LicenseSummary Description string `json:"description"` Html_url string `json:"html_url"` Body string `json:"body"` Permissions []string `json:"permissions"` Conditions []string `json:"conditions"` Limitations []string `json:"limitations"` }
func GetLicense ¶
This function assumes that the `name` passed in is the valid key of the license as specified in the GitHub API. https://docs.github.com/en/rest/licenses/licenses?apiVersion=2022-11-28#get-a-license
func LoadCachedLicense ¶
type LicenseSummary ¶
type LicenseSummary struct { Key string `json:"key"` Name string `json:"name"` Spdx_id string `json:"spdx_id"` Url string `json:"url"` Node_id string `json:"node_id"` }
LicenseSummary struct represents a license.
Currently using the GitHub API to get the list of licenses, so the fields match the object returned by the API.
func ListLicenses ¶
func ListLicenses() ([]LicenseSummary, error)
ListLicenses returns a slice of License structs.
It returns an error if it fails to get the licenses.
func LoadCacheListLicenses ¶
func LoadCacheListLicenses() ([]LicenseSummary, error)
type ListSummaryCache ¶
type ListSummaryCache struct { Age time.Time `json:"age"` LicenseSummary []LicenseSummary `json:"LicenseSummary"` }
Click to show internal directories.
Click to hide internal directories.