Documentation
¶
Overview ¶
Package brand provides the branding indirection layer this project requires: no product name is ever hardcoded in source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Brand ¶
type Brand struct {
Name string `yaml:"name"`
ShortName string `yaml:"short_name"`
BinaryName string `yaml:"binary_name"`
Domain string `yaml:"domain"`
SupportURL string `yaml:"support_url"`
// SupportEmail is a direct contact address, distinct from SupportURL
// (typically a GitHub issue tracker). Optional, same "empty means
// don't render the link" rule as the other contact fields.
SupportEmail string `yaml:"support_email"`
PrimaryColor string `yaml:"primary_color"`
// PrimaryColorDark is the dark-mode variant of PrimaryColor. Optional:
// falls back to PrimaryColor itself when empty, same "empty means use
// the other value" pattern as the other optional fields here.
PrimaryColorDark string `yaml:"primary_color_dark"`
LogoSVG string `yaml:"logo_svg"`
DocsURL string `yaml:"docs_url"`
// DiscussionsURL is the "ask the community" destination (a GitHub
// Discussions board or equivalent). Optional, same "empty means
// don't render the link" rule as DocsURL and SupportURL.
DiscussionsURL string `yaml:"discussions_url"`
// RepoURL is the source repository root (e.g. for a doc page's "View
// on GitHub" link, source.go/gh, or a hosted git server for a fork).
// Same "empty means don't render the link" rule as DocsURL.
RepoURL string `yaml:"repo_url"`
}
Brand holds every user-visible identity string for the running binary. Nothing outside this package should reference a product name directly.
func Load ¶
Load reads brand.yaml from path, then applies APP_BRAND_* environment overrides on top. Env vars win over the file so a deployment can be rebranded without a rebuild. The prefix is deliberately generic rather than tied to the current name, matching the same rebrandability rule this package exists to enforce.
func (*Brand) AgentName ¶ added in v0.2.0
AgentName returns the node agent's unit, container and path stem, the lowercased ShortName plus "-agent".
func (*Brand) RepoSlug ¶ added in v0.2.0
RepoSlug returns the lowercased "owner/name" parsed from RepoURL, or "" if it has no such path.
func (*Brand) RuleCommentPrefix ¶ added in v0.2.0
RuleCommentPrefix returns the host firewall rule comment tag, the lowercased ShortName plus a colon.