Documentation ¶
Index ¶
- Constants
- func Bootstrap(args []string) error
- func Generate(args []string) error
- func Help() error
- func ListLocal() error
- func ListRemote() error
- func NewErrBadFlagSyntax(args ...string) error
- func NewErrCannotFindLicense() error
- func NewErrCannotLocateHomeDir() error
- func NewErrCopyTreeFailed(from, to string) error
- func NewErrCreateDirFailed(p ...string) error
- func NewErrCreateTempDirFailed(p ...string) error
- func NewErrDeserializeFailed(data []byte) error
- func NewErrExecutingTemplate(t *template.Template) error
- func NewErrExpectedLicenseName() error
- func NewErrFetchFailed() error
- func NewErrLoadingTemplate(name string) error
- func NewErrParsingArguments() error
- func NewErrReadFailed() error
- func NewErrRemovePathFailed(p ...string) error
- func NewErrSerializeFailed(l interface{}) error
- func NewErrUnknownArgument(args ...string) error
- func NewErrWriteFileFailed(p ...string) error
- func Version() error
- type ByLicenseKey
- type License
Constants ¶
View Source
const ( LicenseDirectory = ".license" DataDirectory = "data" IndexFile = "licenses.json" RawDirectory = "raw" TemplatesDirectory = "tmpl" )
View Source
const (
NameEnvVariable = "LICENSE_FULL_NAME"
)
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate parses arguments and outputs the selected license. Generate returns a non-nil error if it is unable to do so successfully.
func ListLocal ¶
func ListLocal() error
ListLocal reads the list of available local licenses and prints the list.
func ListRemote ¶
func ListRemote() error
ListRemote fetches the list of remote licenses and prints the list.
func NewErrBadFlagSyntax ¶
func NewErrCannotFindLicense ¶
func NewErrCannotFindLicense() error
func NewErrCannotLocateHomeDir ¶
func NewErrCannotLocateHomeDir() error
func NewErrCreateDirFailed ¶
func NewErrDeserializeFailed ¶
func NewErrExecutingTemplate ¶
func NewErrExpectedLicenseName ¶
func NewErrExpectedLicenseName() error
func NewErrFetchFailed ¶
func NewErrFetchFailed() error
func NewErrLoadingTemplate ¶
func NewErrParsingArguments ¶
func NewErrParsingArguments() error
func NewErrRemovePathFailed ¶
func NewErrWriteFileFailed ¶
Types ¶
type ByLicenseKey ¶
type ByLicenseKey []License
ByLicenseKey implements sort.Interface and can sort Licenses by their Key in alphabetical order.
func (ByLicenseKey) Len ¶
func (a ByLicenseKey) Len() int
func (ByLicenseKey) Less ¶
func (a ByLicenseKey) Less(i, j int) bool
func (ByLicenseKey) Swap ¶
func (a ByLicenseKey) Swap(i, j int)
type License ¶
type License struct { Key string `json:"key"` Name string `json:"name"` Url string `json:"url"` HtmlUrl string `json:"html_url"` Featured bool `json:"featured"` Description string `json:"description"` Category string `json:"category"` Implementation string `json:"implementation"` Required []string `json:"required"` Permitted []string `json:"permitted"` Forbidden []string `json:"forbidden"` Body string `json:"body"` }
License is a representation of a License object as presented in the GitHub API.
Click to show internal directories.
Click to hide internal directories.