Documentation
¶
Overview ¶
Using the GitHub API to get the license information and license text.
Reference: https://choosealicense.com/licenses
Index ¶
Constants ¶
View Source
const ( LICENSE_LIST = "license.json" BASE_URL = "https://raw.githubusercontent.com/caffeine-addictt/waku/%s/licenses/" )
Variables ¶
View Source
var Licenses *[]License
The global "cache" per say so we only need to hit the endpoint once per session.
Functions ¶
func GetLicenseFetchUrl ¶ added in v0.7.0
func GetLicenseFetchUrl() string
func GetLicenses ¶
GetLicenses returns the list of licenses from the GitHub API or returns the cached list if it exists.
Types ¶
type License ¶
type License struct { // This is the full name of the License. // Example: "MIT License" Name string `json:"name"` // This is the SPDX ID of the License. // Example: "MIT" Spdx string `json:"spdx"` // The filename in 'licenses/' Filename string `json:"filename"` // That values the license wants Wants LicenseWants `json:"wants"` }
Returned from the licenses/ directory.
func (*License) GetLicenseText ¶
type LicenseWants ¶
type LicenseWants []string
func (*LicenseWants) UnmarshalJSON ¶
func (l *LicenseWants) UnmarshalJSON(data []byte) error
Will clean up license wants
Click to show internal directories.
Click to hide internal directories.