Documentation
¶
Overview ¶
Package statedir is codex-router's state dir, $XDG_STATE_HOME/codex-router (else ~/.local/state/codex-router): where it is, the privacy rule for its dirs, the layout of a home's stage 2 dir in it, and atomic file writes. Setup writes a home's dir, the edge and the brain read it, and all three must agree on its layout and its check.
Index ¶
Constants ¶
const ( PortFile = "port" TokenFile = "token" )
Files in a home's dir: setup writes the provider port and token, the edge reads them.
Variables ¶
This section is empty.
Functions ¶
func CheckHome ¶
CheckHome checks that the home dir at dir and its parents up to app are private (CheckPrivate): whoever can write there can swap the token or take the link socket.
func CheckPrivate ¶
CheckPrivate accepts a real directory (not a symlink) owned by this user with no group or other access.
func Dir ¶
Dir returns codex-router's state dir, $XDG_STATE_HOME/codex-router, else ~/.local/state/codex-router. Relative values are ignored. It creates nothing.
func HomeDir ¶
HomeDir is the stage 2 dir of a home, <app>/homes/<home id>/, where app is codex-router's state dir (Dir).
func WriteAtomic ¶
WriteAtomic replaces dir/name with data through a temp file (0600) and a rename, so a reader sees the old file or the new one, never a part. The temp file's name starts with a dot.
Types ¶
This section is empty.