Documentation
¶
Index ¶
- Constants
- Variables
- func AnnounceIfActive(uuid string)
- func MarkActive(rows []wsapi.WorkSessionAttributes, activeUUID string)
- func Resolve(flagValue string) (string, error)
- func ResolveAndAnnounce(flagValue string) string
- func RunCurrent(ac *client.AlpaconClient) (string, *wsapi.WorkSession, error)
- func RunUnset() error
- func RunUse(ac *client.AlpaconClient, uuid string) (string, error)
Constants ¶
const WorkSessionEnvVar = "ALPACON_WORK_SESSION"
WorkSessionEnvVar is the environment variable consulted as a fallback when no --work-session flag is given. Resolution order: flag > env var > config.
Variables ¶
var WorkSessionCmd = &cobra.Command{ Use: "work-session", Aliases: []string{"session"}, Short: "Create and manage work sessions", Long: "Create, inspect, and manage work sessions—the approval-gated units that group Websh, WebFTP, and exec access on Alpacon.", RunE: func(cmd *cobra.Command, args []string) error { if err := cmd.Help(); err != nil { return err } return errors.New("a subcommand is required. Use 'alpacon work-session ls', 'alpacon work-session create', 'alpacon work-session describe', 'alpacon work-session use', 'alpacon work-session current', 'alpacon work-session activate', 'alpacon work-session complete', 'alpacon work-session extend', 'alpacon work-session approve', 'alpacon work-session reject', or 'alpacon work-session revoke'. Run 'alpacon work-session --help' for more information") }, }
Functions ¶
func AnnounceIfActive ¶
func AnnounceIfActive(uuid string)
AnnounceIfActive prints "Using work-session <uuid>" to stderr when uuid is non-empty. Stderr keeps stdout clean for --output json.
func MarkActive ¶
func MarkActive(rows []wsapi.WorkSessionAttributes, activeUUID string)
MarkActive decorates the row whose ID matches activeUUID with a "*" marker in its Active column. No-op when activeUUID is empty or no row matches. Exported for unit testing; safe to call with a nil/empty slice.
func Resolve ¶
Resolve returns the effective work-session UUID using flag > env var > config priority.
func ResolveAndAnnounce ¶
ResolveAndAnnounce resolves the work-session UUID, announces it, and exits on error.
func RunCurrent ¶
func RunCurrent(ac *client.AlpaconClient) (string, *wsapi.WorkSession, error)
RunCurrent returns the active work-session UUID and its server-side details. Returns ("", nil, nil) when nothing is set, or (uuid, nil, err) if set but unreachable.
Types ¶
This section is empty.