Documentation
¶
Overview ¶
Package app is the root Bubble Tea model: layout, focus, key routing and asynchronous loading from providers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OpenActions = map[string]linkAction{"go": actGo, "copy": actCopy, "show": actShow}
OpenActions are what lazysecrets open --action takes, the Open link menu's choices that go there.
Functions ¶
Types ¶
type Clipboard ¶
type Clipboard interface {
Write(s string) tea.Cmd
Clear(fingerprint [32]byte) tea.Cmd
// Read returns the clipboard's text, or an error where it can't be
// read (over SSH).
Read() (string, error)
}
Clipboard is implemented by clipboard.Clipboard.
type HandlerSetup ¶
type HandlerSetup struct {
Reason string // why links don't open lazysecrets
// Install sets it up, returning what links open in ("kitty").
Install func() (string, error)
}
HandlerSetup offers to set up the link handler.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
type Options ¶
type Options struct {
// Timeout bounds every provider call. Defaults to 30s.
Timeout time.Duration
// Timeouts override Timeout for the providers of a kind.
Timeouts map[provider.Kind]time.Duration
// Icons shows Nerd Font glyphs next to backends.
Icons bool
// Clipboard defaults to the system clipboard, or OSC52 over SSH.
Clipboard Clipboard
// ClipboardClear clears copied values after this long; 0 disables.
ClipboardClear time.Duration
// OpenURL opens a web page; defaults to the system browser.
OpenURL func(url string) error
// ConfigFiles and StatePath are where lazysecrets reads its config
// and keeps its state, for the status pane.
ConfigFiles []string
StatePath string
// Warning shows when the window opens: what lazysecrets skipped
// instead of failing to start.
Warning string
// Changelog is CHANGELOG.md, for the status pane.
Changelog string
// CacheFile keeps what was loaded between runs; "" keeps it for this
// run only.
CacheFile string
// env files, for repos whose .lazysecrets.yaml names none.
ShareKey string
ShareRules share.Rules
// Dir is the folder lazysecrets runs in: it goes back to where it was
// left there, unless it was started on a link. "" doesn't.
Dir string
// FlatSources lists sources without provider groups.
FlatSources bool
// CollapseGroups starts with the Sources pane's groups folded, when
// there are several.
CollapseGroups bool
// Store keeps stars, notes and the layout; defaults to an unsaved one.
Store *store.Store
// LoadDelay is how long the cursor must rest on a row before its
// contents load (settled); 0 loads at once.
LoadDelay time.Duration
// ExpiryWarning marks items expiring within this long; 0 marks only
// expired ones.
ExpiryWarning time.Duration
// RevealTimeout hides a revealed value after this long; 0 never.
RevealTimeout time.Duration
// HideOnBlur hides a revealed value when the terminal loses focus.
HideOnBlur bool
// OnActive is called on key presses and when the terminal gains
// focus, so the link handler can pick the instance last used.
OnActive func()
// Version is shown at the bottom right ("0.1.0"); empty shows none.
Version string
// Commands are the custom commands from the config (commands.go).
Commands []commands.Command
// Keys, if set, replaces the default keymap (keys.Map.Apply).
Keys *keys.Map
// Updater, if set, finds and installs newer releases (U); with
// UpdateCheck, lazysecrets also looks on its own at startup, at most
// once per UpdateEvery (0 for a day).
Updater *Updater
UpdateCheck bool
UpdateEvery time.Duration
// HandlerSetup, if set, offers to set up the link handler at startup.
HandlerSetup *HandlerSetup
// NoHistory stops counting uses of items for the Recent list.
NoHistory bool
// RecentIcon marks items used lately with ◷ in the lists
// (ui.recentIcon).
RecentIcon bool
// Open is a reference to open at startup (lazysecrets open <ref>).
Open *ref.Ref
// OpenAction, if set, is what to do with Open, rather than asking:
// go to it, and maybe copy or show its value (OpenActions). It ends in
// the list, like Go to, rather than on the details.
OpenAction string
// Styles, if set, replaces the default theme (styles.FromTheme), and
// DefaultFg the terminal's default text colour.
Styles *styles.Styles
DefaultFg color.Color
}
Options configures the app.
Click to show internal directories.
Click to hide internal directories.