product

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package product holds lockfile's names for lockkit, its refusal codes and its command exit codes.

Index

Constants

View Source
const (
	ExitOK      = 0  // answered, or done
	ExitError   = 1  // no console running, or any other error
	ExitRefused = 2  // a refusal (E_* code, unknown_profile included)
	ExitDenied  = 3  // denied by the human, or no answer in time
	ExitUsage   = 64 // bad command line
)

Exit codes of the commands. They depend on the outcome only, never on an answer (docs/security-model.md).

Variables

View Source
var P = kit.Product{
	Name:            "lockfile",
	Tagline:         "Your AI asks about the file. It never reads it.",
	Account:         "lockfile",
	ClientsGroup:    "lockfile-clients",
	KeychainService: "lockfile",
	EnvPrefix:       "LOCKFILE_",
	Version:         Version,
}

P is lockfile for lockkit: account, clients group, directories, sockets.

View Source
var Version = "dev"

Version is the release version, set at build time with -ldflags "-X github.com/DavidGodefroid/lockfile/internal/product.Version=vX.Y.Z".

Functions

func ApprovalRefusal

func ApprovalRefusal(id int64, r ipc.Response) ipc.Response

ApprovalRefusal replaces lockkit's refusal of an approval with a fixed message: the outcome only (docs/security-model.md), never the human's typed reason, which lockkit already keeps in the audit.

func Code

func Code(c answers.Code) refusal.Code

Code is the lockkit refusal code of c. It panics on a code that does not refuse a request: a bug, never a runtime condition.

func Mapped

func Mapped(c answers.Code) bool

Mapped reports whether c refuses a request (and so has a lockkit code).

func Refuse

func Refuse(id int64, c answers.Code) ipc.Response

Refuse is the response refusing request id with c: the message is the closed code itself, the data its code, retry rule and static hint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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