Documentation
¶
Overview ¶
Package terms embeds the GopherTrunk Terms of Service and records the operator's acknowledgment of them.
The canonical document is TERMS_OF_SERVICE.md at the repository root; the copy embedded here must stay byte-identical to it (pinned by TestEmbeddedTermsMatchCanonicalDocument). Acknowledgment is recorded locally as a small marker file under the operator's user config directory — the same location the Windows installer writes after its Terms of Service wizard page — and nothing is ever sent anywhere.
Index ¶
Constants ¶
const EnvVar = "GOPHERTRUNK_ACCEPT_TERMS"
EnvVar names the environment variable that accepts the terms for unattended installs (services, containers, CI).
const Version = 1
Version is the terms-of-service revision this binary ships. Bump it whenever TERMS_OF_SERVICE.md changes materially; operators are then asked to re-acknowledge on the next run. Keep in sync with the TermsVersion define in installer/windows/gophertrunk.iss, which records the same marker on behalf of the Windows installer.
Variables ¶
var Text string
Text is the full Terms of Service document.
Functions ¶
func AcceptedVersion ¶
AcceptedVersion parses the marker file under dir and returns the terms version it records, or 0 when there is no (readable, parseable) marker. A marker from an older terms revision therefore reads as "accepted, but not the current version".
func DefaultDir ¶
DefaultDir returns the directory the acceptance marker lives in: <os.UserConfigDir()>/GopherTrunk (%AppData%\GopherTrunk on Windows, ~/.config/GopherTrunk on Linux), falling back to ~/.gophertrunk when the platform config dir cannot be resolved.
func EnvAccepted ¶
func EnvAccepted() bool
EnvAccepted reports whether GOPHERTRUNK_ACCEPT_TERMS is set to an affirmative value, the unattended-install acceptance path.
func IsAccepted ¶
IsAccepted reports whether the current terms Version has been acknowledged under dir.
func MarkerPath ¶
MarkerPath returns the acceptance-marker path under dir.
Types ¶
This section is empty.