Documentation
¶
Overview ¶
Package traffic owns the M4 "traffic" plugin. It aggregates per- repository view counts from REST /repos/{owner}/{repo}/traffic/views for every repository in base.Computed.RepositoryList. The endpoint requires the `repo` OAuth scope; without it the plugin returns Skipped=true. Repositories that return 403 (owner-only endpoint) are dropped silently and aggregation continues.
Contracts: specs/004-m4-github-plugins/contracts/plugin-p2-graphql.md §12 Data model: specs/004-m4-github-plugins/data-model.md E-033
Index ¶
Constants ¶
const Name = "traffic"
Name is the canonical plugin slug.
Variables ¶
var Plugin plugins.Plugin = &trafficPlugin{}
Plugin is the singleton registered with the global plugin registry.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Skipped bool `json:"skipped,omitempty"`
SkippedReason string `json:"-"`
Views map[string]TrafficView `json:"views"`
Total TrafficView `json:"total"`
}
Result is the JSON payload published under data.Plugins["traffic"].
type TrafficView ¶
TrafficView mirrors the upstream {count, uniques} pair.