Transfer code from API repo to own repo

This commit is contained in:
2021-03-09 18:11:23 +01:00
parent 0e5d737209
commit 5c74f774ff
12 changed files with 473 additions and 1 deletions

16
pixelapi/patreon.go Normal file
View File

@@ -0,0 +1,16 @@
package pixelapi
import (
"fornaxian.tech/pixeldrain_server/api/restapi/apitype"
)
// GetPatreonByID returns information about a patron by the ID
func (p *PixelAPI) GetPatreonByID(id string) (resp apitype.Patron, err error) {
return resp, p.jsonRequest("GET", "patreon/"+id, &resp)
}
// PostPatreonLink links a patreon subscription to the pixeldrain account which
// is logged into this API client
func (p *PixelAPI) PostPatreonLink(id string) (err error) {
return p.jsonRequest("POST", "patreon/"+id+"/link_subscription", nil)
}