Documentation
¶
Index ¶
- Constants
- func IconICO() ([]byte, error)
- func LogoPNG(edge int) ([]byte, error)
- func OGKeyBannerPNG(key string, latest string, versionCount uint64, overlayArr []string, ...) ([]byte, error)
- func OGNodeBannerPNG(moduleCount int, versionCount uint64, tagline string, bottomText string) ([]byte, error)
- func OGVersionBannerPNG(key string, version string, sizeBytes uint64, overlayArr []string, ...) ([]byte, error)
- type ActionObj
- type AlternateObj
- type ArtifactEntryObj
- type ArtifactHashObj
- type CatalogEntryObj
- type CatalogObj
- type ClientObj
- type CodeSnippetObj
- type ContactGroupObj
- type ContextObj
- type KeyObj
- type MetricsObj
- type PageObj
- type RendererObj
- type ServiceObj
- type SourceObj
- type VersionEntryObj
- type VersionHistoryObj
- type VersionObj
Constants ¶
const ( OGBannerWidth = 1200 OGBannerHeight = 630 // OGBannerGenVersion invalidates cached OG-banner ETags on any change in renderer output. OGBannerGenVersion = "2" )
Variables ¶
This section is empty.
Functions ¶
func OGKeyBannerPNG ¶
func OGKeyBannerPNG(key string, latest string, versionCount uint64, overlayArr []string, bottomText string) ([]byte, error)
OGKeyBannerPNG returns the module banner: the key large, latest/count/overlays sub-line, date/domain at the bottom.
Types ¶
type AlternateObj ¶
AlternateObj describes the opposite entry channel when both web and ygg are configured. Host is used for links; CopyHost is used for copy-paste commands such as .pk.ygg.
type ArtifactEntryObj ¶
type ArtifactEntryObj struct {
Name string
Kind string
SizeBytes uint64
Hashes []ArtifactHashObj
URL string
AbsURL string
GoModule bool
}
ArtifactEntryObj describes one downloadable artifact in the version page input. Kind is the plain archive format; Go module archives are separated by GoModule.
type ArtifactHashObj ¶
ArtifactHashObj is one stored digest of an artifact body.
type CatalogEntryObj ¶
type CatalogEntryObj struct {
Key string
LatestVersion string
Source SourceObj
// Go and Composer mark ecosystems serving this key's latest version.
Go bool
Composer bool
}
CatalogEntryObj describes one package key in the catalog input.
type CatalogObj ¶
type CatalogObj struct {
Context ContextObj
Keys []CatalogEntryObj
}
CatalogObj is the external input for catalog.html.
type CodeSnippetObj ¶
CodeSnippetObj describes a command or install recipe supplied by the caller.
type ContactGroupObj ¶
ContactGroupObj is one public contact group from the node info card.
type ContextObj ¶
type ContextObj struct {
Service ServiceObj
Client ClientObj
Alternate AlternateObj
}
ContextObj contains request and service data shared by all page inputs.
type KeyObj ¶
type KeyObj struct {
Context ContextObj
Key string
LatestVersion string
Source SourceObj
Overlays []string
Install []CodeSnippetObj
AltInstall []CodeSnippetObj
Versions []VersionEntryObj
Page PageObj
}
KeyObj is the external input for key.html.
type MetricsObj ¶
type MetricsObj struct {
Context ContextObj
Endpoints []ActionObj
RefreshInterval time.Duration
}
MetricsObj is the external input for metrics.html.
type PageObj ¶
PageObj carries the version count and the two keyset pager cursors. An empty cursor hides that direction's link; Newest gates the "released" date line.
type RendererObj ¶
type RendererObj struct {
// contains filtered or unexported fields
}
RendererObj holds parsed templates and embedded CSS; build it once with New. It is safe for concurrent reads because html/template.Execute is concurrent-safe.
func New ¶
func New() (*RendererObj, error)
New parses all templates and caches embedded CSS for application startup.
func (*RendererObj) Catalog ¶
func (obj *RendererObj) Catalog(inputObj CatalogObj) ([]byte, error)
Catalog renders the key catalog page.
func (*RendererObj) Key ¶
func (obj *RendererObj) Key(inputObj KeyObj) ([]byte, error)
Key renders one key page with versions, pagination, and install snippets.
func (*RendererObj) MetricsIndex ¶
func (obj *RendererObj) MetricsIndex(inputObj MetricsObj) ([]byte, error)
MetricsIndex renders the metric group list page.
func (*RendererObj) Version ¶
func (obj *RendererObj) Version(inputObj VersionObj) ([]byte, error)
Version renders one version page with integrity, downloads, install snippets, notes, and history navigation.
type ServiceObj ¶
type ServiceObj struct {
Name string
Tagline string
HomeURL string
InfoName string
Description string
Location string
Contacts []ContactGroupObj
// BuildVersion and BuildDate come from target/meta_gen for the footer.
BuildVersion string
BuildDate string
}
ServiceObj describes the public service identity, extended by the config info card when set.
type SourceObj ¶
type SourceObj struct {
URL string
Status string
Classification string
// Label is the rendered badge text; git labels prefer the concrete forge host.
Label string
}
SourceObj describes upstream availability and origin metadata.
type VersionEntryObj ¶
type VersionEntryObj struct {
Version string
IngestedAt time.Time
SourceSizeBytes uint64
// Go and Composer mark whether this exact version is served in that ecosystem.
Go bool
Composer bool
}
VersionEntryObj describes one version row in the key page input.
type VersionHistoryObj ¶
VersionHistoryObj describes neighboring versions for the version page.
type VersionObj ¶
type VersionObj struct {
Context ContextObj
Key string
Version string
SourceSizeBytes uint64
UpstreamDeleted bool
IngestedAt time.Time
VerifiedAt time.Time
Detected []string
Source SourceObj
Overlays []string
Degraded []string
Downloads []ArtifactEntryObj
AltDownloads []ArtifactEntryObj
Install []CodeSnippetObj
AltInstall []CodeSnippetObj
ReleaseNotesMarkdown string
History VersionHistoryObj
}
VersionObj is the external input for version.html.