plan

package
v0.26.10 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Plan name canonical identifiers \u2014 use these instead of bare strings.
	PlanFree       = "free"
	PlanStarter    = "starter"
	PlanPro        = "pro"
	PlanEnterprise = "enterprise"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	ID     string   // HTML anchor id
	Label  string   // first column
	Desc   string   // plain-English tooltip shown on click
	Values []string // one per plan, in display order
	Span   bool     // if true, all values are the same — use colspan
}

Feature describes one row in the plans comparison table.

func DisplayFeatures

func DisplayFeatures() []Feature

DisplayFeatures returns the feature comparison rows for the plans table.

type Plan

type Plan struct {
	Name               string
	DisplayName        string
	PriceLabel         string // e.g. "$0/mo*", empty for free
	MaxContributors    int    // per billing period, 0 = unlimited
	RateLimitPerHour   int
	DeepScoring        bool
	AISensing          bool
	BatchAPI           bool
	Webhooks           bool
	HistoryDays        int // score history window in days
	MaxAPIKeys         int
	ComplianceReports  bool
	MaxWatchlists      int    // extra watchlists beyond implicit (0, 1, 3)
	DigestEmail        bool   // whether plan includes email digest
	WatchlistScope     string // "pr", "pr_review", "pr_review_issue"
	EventRetentionDays int    // notification event retention in days
	MaxEventsPerTenant int    // hard cap on stored events per tenant; oldest pruned first
	RiskSummary        string // display value for plans table
	AISensingLabel     string
	APIKeysLabel       string
	AlertsLabel        string
	ComplianceLabel    string
}

Plan defines the capabilities and limits for a billing tier.

func DisplayPlans

func DisplayPlans() []Plan

DisplayPlans returns the plans in display order.

func Free

func Free() Plan

Free returns the free tier plan.

func Get

func Get(name string) (Plan, bool)

Get returns the plan with the given name.

type UpsellInfo

type UpsellInfo struct {
	Message string // what the user gains by upgrading
	CTA     string // button label
	Link    string // button href
}

UpsellInfo describes a plan upgrade prompt shown on the scorecard.

func Upsell

func Upsell(currentPlan string) *UpsellInfo

Upsell returns upgrade messaging for the given plan tier. Returns nil when no upsell applies (pro or highest tier).

Jump to

Keyboard shortcuts

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