Documentation
¶
Overview ¶
Package license provides an adapter to fetch license texts from the GitHub Licenses API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned by the Adapter if a license cannot be // found via the GitHub Licenses API. ErrNotFound = errors.New("license not found") // DefaultAdapter is the default adapter for the GitHub Licenses API. DefaultAdapter = NewAdapter(github.NewClient(nil).Licenses) )
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter adapts to the GitHub Licences API.
func NewAdapter ¶
func NewAdapter(service GitHubLicensesService) *Adapter
NewAdapter creates a new *Adapter for service.
type GitHubLicensesService ¶
type GitHubLicensesService interface {
Get(ctx context.Context, licenseName string) (*github.License, *github.Response, error)
List(ctx context.Context) ([]*github.License, *github.Response, error)
}
GitHubLicensesService is the interface of the GitHub Licenses API Service.
Click to show internal directories.
Click to hide internal directories.