cli

package
v0.50.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package cli contains all logic pertaining to the Pincher CLI state

Index

Constants

View Source
const (
	NotRegistered registrationStatus = iota
	Preregistered
	Registered
)

Variables

This section is empty.

Functions

func ExtractStrings

func ExtractStrings[T any](items []T, f func(T) string) []string

func MaxOfStrings

func MaxOfStrings(s ...string) int

func StartRepl

func StartRepl(cliState *State)

Types

type HandlerFunc

type HandlerFunc func(*State, *handlerContext) error

type Logger

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

Logger handles all slog output. Letting this type have the final say allows for ...what? Why did I do all this again?

func (*Logger) Close

func (l *Logger) Close() error

Close ensures the removal of any empty log file created on the day that the session ended

func (*Logger) New

func (l *Logger) New(level slog.Level) error

type State

type State struct {
	DoneChan *chan bool
	Logger   *Logger
	Config   *config.Config
	Client   *client.Client
	Session  *cliSession
	CmdQueue chan<- string
	// contains filtered or unexported fields
}

State represents the full state of the CLI during a session, regardless of user login. It knows the full context of all systems connected.

func (*State) GetPrompt

func (s *State) GetPrompt() string

GetPrompt returns the proper input prompt to print to the command line, dependent on user activity during this session.

func (*State) NewSession

func (s *State) NewSession()

Jump to

Keyboard shortcuts

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