Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeInclude(include *Include) (interface{}, error)
- func DecodeIncludes(includes []*Include) error
- type CampaignAttributes
- type CampaignData
- type CampaignsResponse
- type Client
- type Cursors
- type Include
- type MemberAttributes
- type MemberData
- type MembersResponse
- type Meta
- type Pagination
- type RelationShip
- type RelationshipData
- type Relationships
- type SocialConnection
- type SocialConnections
- type UserAttributes
- type UserResponse
- type UserResponseData
Constants ¶
View Source
const ( // AuthorizationURL specifies Patreon's OAuth2 authorization endpoint (see https://tools.ietf.org/html/rfc6749#section-3.1). // See Example_refreshToken for examples. AuthorizationURL = "https://www.patreon.com/oauth2/authorize" // AccessTokenURL specifies Patreon's OAuth2 token endpoint (see https://tools.ietf.org/html/rfc6749#section-3.2). // See Example_refreshToken for examples. AccessTokenURL = "https://api.patreon.com/oauth2/token" )
View Source
const ( ChargeStatusPaid = "Paid" ChargeStatusDeclined = "Declined" ChargeStatusDeleted = "Deleted" ChargeStatusPending = "Pending" ChargeStatusRefunded = "Refunded" ChargeStatusFraud = "Fraud" ChargeStatusOther = "Other" )
View Source
const APIBase = "https://www.patreon.com/api/oauth2/v2"
Variables ¶
View Source
var TypeMap = map[string]interface{}{ "user": UserAttributes{}, }
Functions ¶
func DecodeInclude ¶
func DecodeIncludes ¶
Types ¶
type CampaignAttributes ¶
type CampaignAttributes struct {
}
type CampaignData ¶
type CampaignData struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes *CampaignAttributes `json:"attributes"`
}
type CampaignsResponse ¶
type CampaignsResponse struct {
Data []*CampaignData `json:"data"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FetchCampaigns ¶
func (c *Client) FetchCampaigns() (r *CampaignsResponse, err error)
func (*Client) FetchMembers ¶
func (*Client) FetchUser ¶
func (c *Client) FetchUser() (r *UserResponse, err error)
Sample response with email scope for /identity?fields[user]=about,created,email,first_name,full_name,image_url,last_name,social_connections,thumb_url,url,vanity
type Include ¶
type Include struct {
Type string `json:"type"`
ID string `json:"id"`
Attributes json.RawMessage `json:"attributes"`
Decoded interface{} `json:"-"`
}
type MemberAttributes ¶
type MemberAttributes struct {
FullName string `json:"full_name"`
IsFollower bool `json:"is_follower"`
LastChargeData string `json:"last_charge_date"`
LastChargeStatus string `json:"last_charge_status"`
LifetimeSupportCents int `json:"lifetime_support_cents"`
CurrentEntitledAmountCents int `json:"currently_entitled_amount_cents"`
PatronStatus string `json:"patron_status"`
}
type MemberData ¶
type MemberData struct {
Type string `json:"type"`
ID string `json:"id"`
Relationships Relationships `json:"relationships"`
Attributes *MemberAttributes `json:attributes"`
}
type MembersResponse ¶
type MembersResponse struct {
Data []*MemberData `json:"data"`
Included []*Include `json:"included"`
Meta Meta `json:"meta"`
}
type Meta ¶
type Meta struct {
Pagination *Pagination `json:"pagination"`
}
type Pagination ¶
type RelationShip ¶
type RelationShip struct {
Data *RelationshipData `json"data"`
}
type RelationshipData ¶
type Relationships ¶
type Relationships struct {
User RelationShip `json:"user"`
}
type SocialConnection ¶
type SocialConnection struct {
UserID string `json:"user_id"`
}
type SocialConnections ¶
type SocialConnections struct {
Discord *SocialConnection `json:"discord"`
}
type UserAttributes ¶
type UserAttributes struct {
About string `json:"about"`
Created string `json:"created"`
Email string `json:"email"`
Vanity string `json:"vanity"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
FullName string `json:"full_name"`
ImageURL string `json:"image_url"`
ThumbURL string `json:"thumb_url"`
SocialConnections *SocialConnections `json:"social_connections"`
}
type UserResponse ¶
type UserResponse struct {
Data UserResponseData `json:"data"`
}
type UserResponseData ¶
type UserResponseData struct {
ID string `json:"id"`
Type string `json:"type"`
Attributes *UserAttributes `json:"attributes"`
}
Click to show internal directories.
Click to hide internal directories.