terms

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

View Source
const EnvVar = "GOPHERTRUNK_ACCEPT_TERMS"

EnvVar names the environment variable that accepts the terms for unattended installs (services, containers, CI).

View Source
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

View Source
var Text string

Text is the full Terms of Service document.

Functions

func AcceptedVersion

func AcceptedVersion(dir string) int

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

func DefaultDir() (string, error)

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

func IsAccepted(dir string) bool

IsAccepted reports whether the current terms Version has been acknowledged under dir.

func MarkerPath

func MarkerPath(dir string) string

MarkerPath returns the acceptance-marker path under dir.

func Record

func Record(dir, via string) error

Record writes the acceptance marker under dir, creating the directory if needed. via names how acceptance happened ("interactive", "env", "command", "windows-installer") for the operator's own reference.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL