sponsorships

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sponsorships owns the M4 "sponsorships" plugin. It returns the sponsorships the viewer is paying for. In M4 the plugin is scaffolded; the underlying `viewer.sponsorshipsAsSponsor` GraphQL call lands as a follow-up once the schema covers it. The MVP wires the type surface so downstream consumers see the slot.

Contracts: specs/004-m4-github-plugins/contracts/plugin-p2-graphql.md §10 Data model: specs/004-m4-github-plugins/data-model.md E-031

Index

Constants

View Source
const Name = "sponsorships"

Name is the canonical plugin slug.

Variables

View Source
var Plugin plugins.Plugin = &sponsorshipsPlugin{}

Plugin is the singleton registered with the global plugin registry.

Functions

func Partial

Partial renders the sponsorships fragment. DOM contract: <g class="sponsored"> per active entry.

Types

type Result

type Result struct {
	Skipped       bool        `json:"skipped,omitempty"`
	SkippedReason string      `json:"-"`
	Active        []Sponsored `json:"active"`
	Past          []Sponsored `json:"past,omitempty"`
}

Result is the JSON payload published under data.Plugins["sponsorships"].

func (*Result) IsSkipped

func (r *Result) IsSkipped() bool

IsSkipped lets the classic dispatcher detect the skipped path.

type Sponsored struct {
	Login string     `json:"login"`
	Tier  string     `json:"tier"`
	Since time.Time  `json:"since"`
	Until *time.Time `json:"until,omitempty"`
}

Sponsored carries one entry from the upstream sponsorships list.

Jump to

Keyboard shortcuts

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