validate

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package validate provides validation functions for iTerm2 CLI command inputs.

This package contains all validation logic for:

  • Resource IDs (sessions, windows, tabs)
  • Output formats
  • Timeouts and durations
  • Coordinates and values
  • Hex strings and data
  • Resource existence checks

All validation functions return cmderr.StandardError for consistent error handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(format string) error

Format validates an output format specification.

func HexData

func HexData(s string) ([]byte, error)

HexData parses hex-encoded data with common prefixes.

func HexString

func HexString(s string) error

HexString validates a hexadecimal string.

func NonEmpty

func NonEmpty(value, name string) error

NonEmpty validates that a string is not empty.

func OneOf

func OneOf(value string, options []string, name string) error

OneOf validates that a value is one of the allowed options.

func SessionExists

func SessionExists(ctx context.Context, client *client.Client, id string) error

SessionExists checks if a session exists.

func TabExists

func TabExists(ctx context.Context, client *client.Client, id string) error

TabExists checks if a tab exists.

func TabID

func TabID(id string) error

TabID validates a tab ID format. Tab IDs from iTerm2 are simple numeric strings, not UUIDs

func WindowExists

func WindowExists(ctx context.Context, client *client.Client, id string) error

WindowExists checks if a window exists.

func WindowID

func WindowID(id string) error

WindowID validates a window ID format. Window IDs from iTerm2 are in the format "pty-<UUID>"

Types

This section is empty.

Jump to

Keyboard shortcuts

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