Documentation
¶
Overview ¶
Package announce fetches a small remote "announcement" document from a static URL (a raw file in the GitHub repo) so the status window can show occasional messages - a promo, a heads-up, a migration notice - without shipping a new build. It is best-effort and read-only: any error yields an inactive announcement so the UI simply shows nothing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SourceURL = "https://raw.githubusercontent.com/codepurse/extension-guard/main/announcement.json"
SourceURL is the raw announcement document the status window reads. It is a var so tests can point it at a local server. To change what users see, edit the file at this URL and push - no new release required (raw.githubusercontent.com caches for a few minutes).
Functions ¶
This section is empty.
Types ¶
type Announcement ¶
type Announcement struct {
ID string `json:"id"`
Active bool `json:"active"`
Level string `json:"level"`
Title string `json:"title"`
Message string `json:"message"`
URL string `json:"url"`
URLFirefox string `json:"urlFirefox"`
LinkText string `json:"linkText"`
}
Announcement mirrors the announcement.json document. The schema is shared with the developer's other apps so one format serves all of them; unknown fields are ignored. An empty or Active=false document means "show nothing". Level is one of "info" (default), "warn", or "danger" and only drives banner styling. URL is the primary link (e.g. a Chrome Web Store page); URLFirefox is an optional browser-specific alternative the frontend falls back to.