base

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2015 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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 Bootstrap

func Bootstrap(args []string) error

Bootstrap updates local licenses to the latest online versions

func Generate

func Generate(args []string) error

Generate parses arguments and outputs the selected license. Generate returns a non-nil error if it is unable to do so successfully.

func Help

func Help() error

Help prints help information for the program to the console

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 NewErrBadFlagSyntax(args ...string) error

func NewErrCannotFindLicense

func NewErrCannotFindLicense() error

func NewErrCannotLocateHomeDir

func NewErrCannotLocateHomeDir() error

func NewErrCopyTreeFailed

func NewErrCopyTreeFailed(from, to string) error

copy tree error

func NewErrCreateDirFailed

func NewErrCreateDirFailed(p ...string) error

func NewErrCreateTempDirFailed

func NewErrCreateTempDirFailed(p ...string) error

path errors

func NewErrDeserializeFailed

func NewErrDeserializeFailed(data []byte) error

func NewErrExecutingTemplate

func NewErrExecutingTemplate(t *template.Template) error

func NewErrExpectedLicenseName

func NewErrExpectedLicenseName() error

func NewErrFetchFailed

func NewErrFetchFailed() error

func NewErrLoadingTemplate

func NewErrLoadingTemplate(name string) error

func NewErrParsingArguments

func NewErrParsingArguments() error

func NewErrReadFailed

func NewErrReadFailed() error

basic errors

func NewErrRemovePathFailed

func NewErrRemovePathFailed(p ...string) error

func NewErrSerializeFailed

func NewErrSerializeFailed(l interface{}) error

data errors

func NewErrUnknownArgument

func NewErrUnknownArgument(args ...string) error

argument errors

func NewErrWriteFileFailed

func NewErrWriteFileFailed(p ...string) error

func Version

func Version() error

Version prints the version number

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.

func (*License) String

func (l *License) String() string

Jump to

Keyboard shortcuts

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