Documentation
¶
Overview ¶
Package session manages named execution sessions with isolated state. Sessions allow teams to run multiple independent plan variants without overwriting each other. Each session stores its own state.db in .cloop/sessions/<name>/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveDir ¶
ActiveDir returns the effective state directory:
- workDir if no session is active
- workDir/.cloop/sessions/<name> if a session is active
func ActiveName ¶
ActiveName returns the currently active session name, or "" for the default.
func Switch ¶
Switch sets the active session. Pass "" to clear (use default).
The write to .cloop/active_session is atomic — a torn write (crash mid- write, ENOSPC) would leave a 0-byte file, and ActiveName would silently route every subsequent command to the default session, hiding the user's real working state.
Types ¶
type Session ¶
type Session struct {
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
StateFile string `json:"state_file"` // relative path from workDir
ConfigFile string `json:"config_file"` // relative path from workDir
}
Session describes a named execution session.