compaz

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package compaz implements Compa/z, the z/OSMF operator console used by the separate compaz executable (formerly cqt).

Index

Constants

View Source
const (
	MinTerminalWidth = 52
)

Variables

This section is empty.

Functions

func MinTerminalHeight

func MinTerminalHeight() int

MinTerminalHeight returns the smallest usable terminal height.

func RowBudget

func RowBudget(visibleRows int) int

RowBudget is the exact maximum item count used for every browse request.

func VisibleRows

func VisibleRows(width, height int) int

VisibleRows returns the number of data rows available in the terminal. A non-positive result is a hard boundary: callers must not issue a row fetch.

Types

type CopybookSource

type CopybookSource struct {
	Local  string
	DSN    string
	Format string
	Record string
}

CopybookSource describes an optional display overlay. Exactly one of Local and DSN must be set when the source is applied.

type Dependencies

type Dependencies struct {
	LoadSession   func(ctx context.Context, profile string) (Session, error)
	ListProfiles  func(context.Context) ([]string, error)
	LoadFile      func(context.Context, string) ([]byte, error)
	Mappings      MappingStore
	Favorites     FavoriteStore
	Events        EventRecorder
	DSNSearchPath []string
	Timeout       time.Duration
}

Dependencies provide test seams without weakening the production command's read-only boundaries.

type EventRecorder

type EventRecorder interface {
	RecordOpen(name string)
	RecordQuery(expr string, ok bool)
}

EventRecorder appends local usage events — data set opens and executed jq queries — for the future suggestion engine and the query history. A nil recorder disables tracking.

type FavoriteStore

type FavoriteStore interface {
	Favorites(profile string, kind favorites.Kind) []favorites.Favorite
	Matches(profile string, kind favorites.Kind, name string) bool
	Toggle(profile string, kind favorites.Kind, name string) (bool, error)
	Add(profile string, kind favorites.Kind, pattern string) error
	Rename(profile string, kind favorites.Kind, oldPattern, newPattern string) error
	SetNote(profile string, kind favorites.Kind, pattern, note string) error
	Remove(profile string, kind favorites.Kind, pattern string) (bool, error)
	Touch(profile string, kind favorites.Kind, pattern string) error
}

FavoriteStore persists data set favorites across sessions. A nil store disables favorites. FavoriteStore persists data set favorites keyed by z/OSMF profile; the empty profile holds entries shared across profiles (single-profile sessions and favorites saved before profile keying).

type KeyMap

type KeyMap struct {
	Up              key.Binding
	Down            key.Binding
	PageUp          key.Binding
	PageDown        key.Binding
	Top             key.Binding
	Bottom          key.Binding
	Open            key.Binding
	Back            key.Binding
	Search          key.Binding
	Locate          key.Binding
	Refresh         key.Binding
	Copybook        key.Binding
	ClearOverlay    key.Binding
	ToggleOverlay   key.Binding
	ToggleView      key.Binding
	Diagnostics     key.Binding
	Help            key.Binding
	Quit            key.Binding
	WideLeft        key.Binding
	WideRight       key.Binding
	Accept          key.Binding
	Cancel          key.Binding
	NextField       key.Binding
	PreviousField   key.Binding
	MappingAdd      key.Binding
	MappingEdit     key.Binding
	MappingRemove   key.Binding
	ToggleFavorite  key.Binding
	Favorites       key.Binding
	Recall          key.Binding
	Jobs            key.Binding
	FavoriteNote    key.Binding
	FavoriteRemove  key.Binding
	FavoriteAdd     key.Binding
	FavoriteEdit    key.Binding
	FavoriteOpen    key.Binding
	Edit            key.Binding
	Query           key.Binding
	QueryComplete   key.Binding
	QueryCopy       key.Binding
	SaveEdit        key.Binding
	ReloadEdit      key.Binding
	DiscardEdit     key.Binding
	NextProfile     key.Binding
	PreviousProfile key.Binding
}

KeyMap is the single source of truth for application, input, dialog, and wide-data bindings. Function keys are intentionally assigned only here.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

type MappingStore

type MappingStore interface {
	Match(name string) (dsnmap.Mapping, bool)
	Matches(name string) []dsnmap.Mapping
	Put(mapping dsnmap.Mapping) error
	Remove(pattern string) (bool, error)
	Touch(pattern string) error
}

MappingStore persists DSN → copybook mappings across sessions. A nil store disables mapping persistence.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model is the Bubble Tea state machine. It is read-only: actions can only navigate, filter, fetch, decode, or change presentation.

The active workspace is embedded so that existing code paths can continue to read per-profile fields (datasets, records, pagers, etc.) directly. Inactive workspaces are stored in the workspaces slice and swapped in on profile switches.

func NewModel

func NewModel(options Options, deps Dependencies) (*Model, error)

NewModel validates static options and constructs a model whose work begins in Init. No network, filesystem, copybook, or decoding operation runs here.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init loads the Zowe session in a typed command. Window-size handling remains independent, so a session can resolve in a tiny terminal without dispatching a row request.

func (*Model) Update

func (m *Model) Update(message tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Model) View

func (m *Model) View() tea.View

type Options

type Options struct {
	Prefix      string
	Copybook    string
	CopybookDSN string
	Format      string
	Record      string
	Codepage    string
	// ReadOnly disables edit mode entirely, restoring the strictly read-only
	// console guarantee for operators who want it.
	ReadOnly bool
}

Options are the approved compaz command-line settings.

type RecordMode

type RecordMode uint8
const (
	ModeRaw RecordMode = iota
	ModeTable
	ModeJSON
)

type Screen

type Screen uint8
const (
	ScreenDataSets Screen = iota
	ScreenMembers
	ScreenRecords
	// ScreenJobs, ScreenSpoolFiles, and ScreenSpoolContent are a second,
	// parallel drill-down (owner/prefix-filtered jobs -> a job's spool/DD
	// files -> one spool file's text), reachable from ScreenDataSets and
	// back-navigable to it, mirroring the data set chain above.
	ScreenJobs
	ScreenSpoolFiles
	ScreenSpoolContent
)

type Session

type Session struct {
	Browser  zosmf.Browser
	User     string
	Encoding string
}

Session is the credential-safe application session returned by an injected loader. Browser contains the bounded read-only operations only.

Jump to

Keyboard shortcuts

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