gamify

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package gamify computes contributor achievements, badges, and levels for release gamification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatConfluence

func FormatConfluence(achievements []ContributorAchievements) string

func FormatMarkdown

func FormatMarkdown(results []ContributorResult) string

Types

type Achievement

type Achievement struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Rarity      string `json:"rarity"`
	Emoji       string `json:"emoji"`
}

type Badge

type Badge struct {
	Emoji  string
	Name   string
	Reason string
}

type ContributorAchievements

type ContributorAchievements struct {
	Name         string
	Commits      int
	Level        int
	LevelName    string
	Badges       []Badge
	Achievements []Achievement
	TotalCommits int
	Streak       int
}

func GenerateAchievements

func GenerateAchievements(ctx context.Context, results []ContributorResult, snapshots []trends.Snapshot, client ai.Client, lang string) []ContributorAchievements

type ContributorResult

type ContributorResult struct {
	Name      string
	Commits   int
	Badges    []Badge
	Level     int
	LevelName string
}

func Compute

func Compute(commits []commit.Commit, reportMetrics metrics.ReportMetrics, snapshots []trends.Snapshot, opts Options) []ContributorResult

type ContributorStats

type ContributorStats struct {
	Name          string   `json:"name"`
	Commits       int      `json:"commits"`
	Level         int      `json:"level"`
	LevelName     string   `json:"level_name"`
	FeatCount     int      `json:"feat_count"`
	FixCount      int      `json:"fix_count"`
	RefactorCount int      `json:"refactor_count"`
	TotalCommits  int      `json:"total_commits"`
	Streak        int      `json:"streak"`
	Badges        []string `json:"badges"`
}

type Options

type Options struct {
	ShowLevels    bool
	ShowStreaks   bool
	NightOwlHour  int
	EarlyBirdHour int
}

Jump to

Keyboard shortcuts

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