ui

package
v0.0.0-...-694a2a2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMsgInvalidDataFormat             = "Invalid data format"
	ErrMsgNoDataFound                   = "No data found"
	ErrMsgNoDataAvailable               = "No data available"
	ErrMsgServiceTemporarilyUnavailable = "Service temporarily unavailable"
	ErrMsgInvalidIPAddress              = "Invalid IP address"
	ErrMsgConnectionFailed              = "Connection failed"
	ErrMsgProviderNotConfigured         = "Provider not configured"
	ErrMsgAuthenticationRequired        = "Authentication required"
	ErrMsgServiceError                  = "Service error"
)

Error message constants

View Source
const (
	// Grid dimensions
	GridRows          = 4
	GridColumns       = 2
	ProvidersColWidth = 18

	// Grid row indices
	TopBarRow  = 0
	HeaderRow  = 1
	ContentRow = 2
	FooterRow  = 3

	// Grid column indices
	ProvidersCol = 0
	ResultsCol   = 1

	// Provider list indices
	PTRProviderIndex = 0

	// File permissions
	LogFilePerms = 0o666

	// UI Messages
	PressEnterMsg   = "Press enter to load"
	PlaceholderText = "  Enter IP address or FQDN/hostname"
	FooterText      = "(i) input | (p) providers | (←) back to providers | (→) focus results | (q) quit | Ctrl+C confirm quit"
	ProvidersHeader = "Providers"
	ResultsHeader   = "Results"
	LogFileName     = "app.log"

	// Loading spinner
	LoadingMsg = "Loading provider data..."
)

UI Layout Constants

Variables

View Source
var (
	ErrNoDataAvailable = errors.New("no data available")
	ErrInvalidIP       = errors.New("invalid IP address")
	ErrProviderError   = errors.New("provider unavailable")
	ErrParsingFailed   = errors.New("data parsing failed")
)

Common UI error variables for simplified user messages

View Source
var ProgramLevel = new(slog.LevelVar) // Info by default

Functions

func OpenUI

func OpenUI() error

func ToPtr

func ToPtr[T any](v T) *T

Types

type Config

type Config struct {
	session.Session
	Shodan     shodan.Config
	CriminalIP criminalip.Config
	IPURL      ipurl.Config
}

type Processor

type Processor struct {
	Session *session.Session
}

func New

func New(sess *session.Session) Processor

func (*Processor) Run

func (p *Processor) Run(providerName string) (string, error)

type Provider

type Provider struct {
	Name      string
	Enabled   *bool
	APIKey    string
	NewClient func(c session.Session) (providers.ProviderClient, error)
}

Jump to

Keyboard shortcuts

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