utils

package
v0.0.0-...-15a57b5 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keys = KeyMap{
	PrevLayer: key.NewBinding(
		key.WithKeys("up", "k"),
		key.WithHelp("↑/k", "move up"),
	),
	NextLayer: key.NewBinding(
		key.WithKeys("down", "j"),
		key.WithHelp("↓/j", "move down"),
	),
	Prestige: key.NewBinding(
		key.WithKeys("p"),
		key.WithHelp("p", "prestige"),
	),
	Quit: key.NewBinding(
		key.WithKeys("q", "esc", "ctrl+c"),
		key.WithHelp("q", "quit"),
	),
}

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func IntPtr

func IntPtr(u int) *int

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func StringPtr

func StringPtr(s string) *string

func TruncateString

func TruncateString(str string, num int) string

func TruncateStringTrailing

func TruncateStringTrailing(str string, num int) string

func UintPtr

func UintPtr(u uint) *uint

Types

type KeyMap

type KeyMap struct {
	PrevLayer key.Binding
	NextLayer key.Binding
	Prestige  key.Binding
	Help      key.Binding
	Quit      key.Binding
}

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

Jump to

Keyboard shortcuts

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