Documentation
¶
Overview ¶
Package licenses defines a base type and support functions for describing software licenses.
Index ¶
Constants ¶
const PerFileNotice = `
Copyright (C) {{date "2006"}} {{.Author}}. All Rights Reserved.
`
PerFileNotice is a generic per-file license statement that can be added to any license that does not have more specific language to recommend.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// The name of the author, to whom copyright is attributed.
Author string
// The name of the project to which the license is attached, if different
// from the author. Example: "FreeBSD".
Project string
// The current time. The template can render this field using the "time" and
// "date" functions provided in the function map.
Time time.Time
}
Config carries parameters to be expanded by text templates for a license.
type Indenting ¶
type Indenting func(*block) *block
An Indenting is a rule for indenting or commenting license text for insertion into a file. A nil Indenting leaves the input text unmodified.
type License ¶
type License struct {
// A human-readable name of the license.
// For example: "Apache License, Version 2.0".
Name string
// A slug used to identify the license. This value must be unique across all
// registered licenses. Good slug values should be short, ideally one word,
// with no spaces.
Slug string
// A URL to a description of the license (optional).
URL string
// The text of the license (template, required).
Text string
// Additional license text that must be inserted into each file covered by
// the license (template, optional).
PerFile string
}
A License describes a software license.
A package that implements a license should call license.Register during init with a value of this type, suitably populated with values corresponding to the details of that license.
func Lookup ¶
Lookup returns the license information for the specified slug, or nil if no such license is registered.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apache describes the Apache software licenses.
|
Package apache describes the Apache software licenses. |
|
Package bsd describes BSD software licenses.
|
Package bsd describes BSD software licenses. |
|
Package cc describes Creative Commons software licenses.
|
Package cc describes Creative Commons software licenses. |
|
Package gpl describes the GNU GPL software licenses.
|
Package gpl describes the GNU GPL software licenses. |
|
Package mit describes "the" MIT software licenses.
|
Package mit describes "the" MIT software licenses. |
|
Package unlicense describes the unlicense.
|
Package unlicense describes the unlicense. |