{"modulePath":"github.com/brevdev/brev-cli","version":"v0.6.337","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sudo\n\n## Types\n\n```go\ntype CachedGater struct{}\n```\nCachedGater is a Gater that always acts as if sudo is cached (no prompt, no refresh). For tests.\n\n```go\nfunc (CachedGater) Gate(*terminal.Terminal, terminal.Confirmer, string, bool) error\n```\n\n```go\ntype Gater interface {\n\tGate(t *terminal.Terminal, confirmer terminal.Confirmer, reason string, assumeYes bool) error\n}\n```\nGater gates execution on sudo availability; callers can use Default or inject a stub in tests.\n\n```go\nvar Default Gater = \u0026systemGater{}\n```\nDefault is the Gater used by commands. Tests may replace it with a stub.\n\n```go\ntype Status int\n```\nStatus represents the current sudo/root status of the process.\n\n```go\nconst (\n\t// StatusRoot means the process is already running as root.\n\tStatusRoot Status = 0\n\t// StatusCached means the user has a valid sudo timestamp (no password needed).\n\tStatusCached Status = 1\n\t// StatusUncached means sudo will require a password prompt.\n\tStatusUncached Status = 2\n)\n```\n\n","path":"github.com/brevdev/brev-cli/pkg/sudo","name":"sudo","synopsis":"","isRedistributable":true}
