social

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	IconURL     string `json:"icon_url"`
	Rarity      string `json:"rarity"`
}

type LeaderboardEntry

type LeaderboardEntry struct {
	Rank         int    `json:"rank"`
	UserID       string `json:"user_id"`
	DisplayName  string `json:"display_name"`
	TotalSavings int    `json:"total_savings"`
	Tier         string `json:"tier"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL