Documentation
¶
Overview ¶
Package funding discovers the funding links a repository advertises, the same way GitHub does for the Sponsor button: a FUNDING.yml file, looked up in the places GitHub looks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Links ¶
type Links struct {
GitHub StringList `yaml:"github" json:"github,omitempty"`
Patreon string `yaml:"patreon" json:"patreon,omitempty"`
OpenCollective string `yaml:"open_collective" json:"open_collective,omitempty"`
KoFi string `yaml:"ko_fi" json:"ko_fi,omitempty"`
Tidelift string `yaml:"tidelift" json:"tidelift,omitempty"`
CommunityBridge string `yaml:"community_bridge" json:"community_bridge,omitempty"`
Liberapay string `yaml:"liberapay" json:"liberapay,omitempty"`
IssueHunt string `yaml:"issuehunt" json:"issuehunt,omitempty"`
LFXCrowdfunding string `yaml:"lfx_crowdfunding" json:"lfx_crowdfunding,omitempty"`
Polar string `yaml:"polar" json:"polar,omitempty"`
BuyMeACoffee string `yaml:"buy_me_a_coffee" json:"buy_me_a_coffee,omitempty"`
ThanksDev string `yaml:"thanks_dev" json:"thanks_dev,omitempty"`
Otechie string `yaml:"otechie" json:"otechie,omitempty"`
Custom StringList `yaml:"custom" json:"custom,omitempty"`
}
Links is the parsed content of a FUNDING.yml file.
func Discover ¶
func Discover(ctx context.Context, files forges.FileService, owner, repo, ref string) (Links, error)
Discover reads the funding file GitHub would read for owner/repo; an empty ref reads the default branch, and a missing file moves to the next location.
type StringList ¶
type StringList []string
StringList is a value GitHub accepts either as one entry or as a list of them: "github" and "custom" both allow either.
func (*StringList) UnmarshalYAML ¶
func (l *StringList) UnmarshalYAML(node *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.