views

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPayloadDisplayRunes = 4096

MaxPayloadDisplayRunes limits how much of a payload we show in the TUI to keep rendering fast.

Variables

This section is empty.

Functions

func FormatPayloadForDisplay added in v0.0.2

func FormatPayloadForDisplay(raw []byte) string

FormatPayloadForDisplay pretty-prints JSON payload and truncates if too long.

Types

type ApprovalResultMsg

type ApprovalResultMsg struct {
	Success bool
	Message string
	Err     error
}

ApprovalResultMsg is sent when approval/rejection is complete

type AuditDataMsg

type AuditDataMsg struct {
	Records      []client.AuditRecord
	Total        int
	NextCursor   *string
	NextCursorID *string
	HasMore      bool
	Err          error
}

AuditDataMsg is sent when audit data is loaded

type AuditDetailRequestMsg added in v0.0.2

type AuditDetailRequestMsg struct {
	Request *client.RequestStatus
	Err     error
}

AuditDetailRequestMsg is sent when the request for the selected audit record is loaded (detail view).

type AuditModel

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

AuditModel represents the audit logs view

func NewAuditModel

func NewAuditModel(c client.ClientInterface, ctx context.Context) (*AuditModel, error)

NewAuditModel creates a new audit model

func (*AuditModel) Init

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

Init initializes the audit view

func (*AuditModel) Refresh

func (m *AuditModel) Refresh() tea.Cmd

Refresh refreshes the audit data

func (*AuditModel) SetSize

func (m *AuditModel) SetSize(width, height int)

SetSize sets the view size

func (*AuditModel) Update

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

Update handles messages

func (*AuditModel) View

func (m *AuditModel) View() string

View renders the audit view

type DashboardData

type DashboardData struct {
	Health        *client.HealthResponse
	RequestCounts map[string]int
	TotalRequests int
	TotalRules    int
	LastRefresh   time.Time
}

DashboardData holds the data for the dashboard

type DashboardDataMsg

type DashboardDataMsg struct {
	Data *DashboardData
	Err  error
}

DashboardDataMsg is sent when dashboard data is loaded

type DashboardModel

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

DashboardModel represents the dashboard view

func NewDashboardModel

func NewDashboardModel(c client.ClientInterface, ctx context.Context) (*DashboardModel, error)

NewDashboardModel creates a new dashboard model

func (*DashboardModel) Init

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

Init initializes the dashboard

func (*DashboardModel) Refresh

func (m *DashboardModel) Refresh() tea.Cmd

Refresh refreshes the dashboard data

func (*DashboardModel) SetSize

func (m *DashboardModel) SetSize(width, height int)

SetSize sets the view size

func (*DashboardModel) Update

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

Update handles messages

func (*DashboardModel) View

func (m *DashboardModel) View() string

View renders the dashboard

type MetricsDataMsg added in v0.0.2

type MetricsDataMsg struct {
	Raw string
	Err error
}

type MetricsModel added in v0.0.2

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

func NewMetricsModel added in v0.0.2

func NewMetricsModel(c client.ClientInterface, ctx context.Context) (*MetricsModel, error)

func (*MetricsModel) Init added in v0.0.2

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

func (*MetricsModel) Refresh added in v0.0.2

func (m *MetricsModel) Refresh() tea.Cmd

func (*MetricsModel) SetSize added in v0.0.2

func (m *MetricsModel) SetSize(width, height int)

func (*MetricsModel) Update added in v0.0.2

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

func (*MetricsModel) View added in v0.0.2

func (m *MetricsModel) View() string

type PreviewRuleMsg

type PreviewRuleMsg struct {
	Rule *client.Rule
	Err  error
}

PreviewRuleMsg is sent when rule preview is loaded

type RequestDetailDataMsg

type RequestDetailDataMsg struct {
	Request *client.RequestStatus
	Err     error
}

RequestDetailDataMsg is sent when request detail is loaded

type RequestDetailModel

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

RequestDetailModel represents the request detail view

func NewRequestDetailModel

func NewRequestDetailModel(c client.ClientInterface, ctx context.Context) (*RequestDetailModel, error)

NewRequestDetailModel creates a new request detail model

func (*RequestDetailModel) Init

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

Init initializes the view

func (*RequestDetailModel) LoadRequest

func (m *RequestDetailModel) LoadRequest(requestID string) tea.Cmd

LoadRequest loads a request by ID

func (*RequestDetailModel) ResetGoBack

func (m *RequestDetailModel) ResetGoBack()

ResetGoBack resets the go back flag

func (*RequestDetailModel) SetSize

func (m *RequestDetailModel) SetSize(width, height int)

SetSize sets the view size

func (*RequestDetailModel) ShouldGoBack

func (m *RequestDetailModel) ShouldGoBack() bool

ShouldGoBack returns true if the view should go back to the list

func (*RequestDetailModel) Update

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

Update handles messages

func (*RequestDetailModel) View

func (m *RequestDetailModel) View() string

View renders the request detail view

type RequestsDataMsg

type RequestsDataMsg struct {
	Requests     []client.RequestStatus
	Total        int
	NextCursor   *string
	NextCursorID *string
	HasMore      bool
	Err          error
}

RequestsDataMsg is sent when requests data is loaded

type RequestsModel

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

RequestsModel represents the requests list view

func NewRequestsModel

func NewRequestsModel(c client.ClientInterface, ctx context.Context) (*RequestsModel, error)

NewRequestsModel creates a new requests model

func (*RequestsModel) GetSelectedRequestID

func (m *RequestsModel) GetSelectedRequestID() string

GetSelectedRequestID returns the ID of the selected request

func (*RequestsModel) Init

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

Init initializes the requests view

func (*RequestsModel) Refresh

func (m *RequestsModel) Refresh() tea.Cmd

Refresh refreshes the requests data

func (*RequestsModel) SetSize

func (m *RequestsModel) SetSize(width, height int)

SetSize sets the view size

func (*RequestsModel) Update

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

Update handles messages

func (*RequestsModel) View

func (m *RequestsModel) View() string

View renders the requests view

type RuleActionMsg

type RuleActionMsg struct {
	Action  string
	Success bool
	Message string
	Err     error
}

RuleActionMsg is sent when a rule action is complete

type RuleDetailActionMsg

type RuleDetailActionMsg struct {
	Action  string
	Success bool
	Message string
	Err     error
}

RuleDetailActionMsg is sent when a rule action is complete

type RuleDetailDataMsg

type RuleDetailDataMsg struct {
	Rule *client.Rule
	Err  error
}

RuleDetailDataMsg is sent when rule detail is loaded

type RuleDetailModel

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

RuleDetailModel represents the rule detail view

func NewRuleDetailModel

func NewRuleDetailModel(c client.ClientInterface, ctx context.Context) (*RuleDetailModel, error)

NewRuleDetailModel creates a new rule detail model

func (*RuleDetailModel) Init

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

Init initializes the view

func (*RuleDetailModel) LoadRule

func (m *RuleDetailModel) LoadRule(ruleID string) tea.Cmd

LoadRule loads a rule by ID

func (*RuleDetailModel) ResetGoBack

func (m *RuleDetailModel) ResetGoBack()

ResetGoBack resets the go back flag

func (*RuleDetailModel) SetSize

func (m *RuleDetailModel) SetSize(width, height int)

SetSize sets the view size

func (*RuleDetailModel) ShouldGoBack

func (m *RuleDetailModel) ShouldGoBack() bool

ShouldGoBack returns true if the view should go back to the list

func (*RuleDetailModel) Update

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

Update handles messages

func (*RuleDetailModel) View

func (m *RuleDetailModel) View() string

View renders the rule detail view

type RulesDataMsg

type RulesDataMsg struct {
	Rules []client.Rule
	Total int
	Err   error
}

RulesDataMsg is sent when rules data is loaded

type RulesModel

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

RulesModel represents the rules list view

func NewRulesModel

func NewRulesModel(c client.ClientInterface, ctx context.Context) (*RulesModel, error)

NewRulesModel creates a new rules model

func (*RulesModel) GetSelectedRuleID

func (m *RulesModel) GetSelectedRuleID() string

GetSelectedRuleID returns the ID of the selected rule

func (*RulesModel) Init

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

Init initializes the rules view

func (*RulesModel) Refresh

func (m *RulesModel) Refresh() tea.Cmd

Refresh refreshes the rules data

func (*RulesModel) SetSize

func (m *RulesModel) SetSize(width, height int)

SetSize sets the view size

func (*RulesModel) Update

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

Update handles messages

func (*RulesModel) View

func (m *RulesModel) View() string

View renders the rules view

type SignerCreateMsg

type SignerCreateMsg struct {
	Signer  *client.Signer
	Success bool
	Message string
	Err     error
}

SignerCreateMsg is sent when a signer is created

type SignersDataMsg

type SignersDataMsg struct {
	Signers []client.Signer
	Total   int
	HasMore bool
	Err     error
}

SignersDataMsg is sent when signers data is loaded

type SignersModel

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

SignersModel represents the signers list view

func NewSignersModel

func NewSignersModel(c client.ClientInterface, ctx context.Context) (*SignersModel, error)

NewSignersModel creates a new signers model

func (*SignersModel) Init

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

Init initializes the signers view

func (*SignersModel) Refresh

func (m *SignersModel) Refresh() tea.Cmd

Refresh refreshes the signers data

func (*SignersModel) SetSize

func (m *SignersModel) SetSize(width, height int)

SetSize sets the view size

func (*SignersModel) Update

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

Update handles messages

func (*SignersModel) View

func (m *SignersModel) View() string

View renders the signers view

Jump to

Keyboard shortcuts

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