Documentation
¶
Index ¶
- type Badge
- type LeaderboardEntry
- type SocialPlatform
- func (sp *SocialPlatform) AddBadge(badge *Badge)
- func (sp *SocialPlatform) AwardBadge(userID, badgeID string)
- func (sp *SocialPlatform) GetLeaderboard(limit int) []LeaderboardEntry
- func (sp *SocialPlatform) GetUserProfile(userID string) *UserProfile
- func (sp *SocialPlatform) RegisterUser(profile *UserProfile)
- func (sp *SocialPlatform) UpdateSavings(userID string, savings int)
- type UserProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LeaderboardEntry ¶
type SocialPlatform ¶
type SocialPlatform struct {
// contains filtered or unexported fields
}
func NewSocialPlatform ¶
func NewSocialPlatform() *SocialPlatform
func (*SocialPlatform) AddBadge ¶
func (sp *SocialPlatform) AddBadge(badge *Badge)
func (*SocialPlatform) AwardBadge ¶
func (sp *SocialPlatform) AwardBadge(userID, badgeID string)
func (*SocialPlatform) GetLeaderboard ¶
func (sp *SocialPlatform) GetLeaderboard(limit int) []LeaderboardEntry
func (*SocialPlatform) GetUserProfile ¶
func (sp *SocialPlatform) GetUserProfile(userID string) *UserProfile
func (*SocialPlatform) RegisterUser ¶
func (sp *SocialPlatform) RegisterUser(profile *UserProfile)
func (*SocialPlatform) UpdateSavings ¶
func (sp *SocialPlatform) UpdateSavings(userID string, savings int)
type UserProfile ¶
type UserProfile struct {
ID string `json:"id"`
GitHubLogin string `json:"github_login"`
DisplayName string `json:"display_name"`
AvatarURL string `json:"avatar_url"`
TotalSavings int `json:"total_savings"`
Tier string `json:"tier"`
Badges []string `json:"badges"`
CreatedAt time.Time `json:"created_at"`
}
Click to show internal directories.
Click to hide internal directories.