License is a library for enforcing software licenses. Currently supports Gumroad license keys.
go get github.com/jchenry/license
func main(){
fmt.Println(license.EnforceWith(
func(scope string) bool {
return s == "set-license" || s == "show-license"
},
license.Gumroad,
func (f license.Activation) error{
if !f.Active{
return fmt.Errorf("software license is not active"
}
})(c.Command.Name, "<someproductid>", "<somekey>"))
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.