utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableViewportKeys

func DisableViewportKeys(viewport viewport.Model) viewport.Model

Disables the letter keys to prevent moving of viewport with the typing

func EnsureExists

func EnsureExists(file string) (*os.File, error)

Ensures if the directory for the file exists, and then creates the file

func Map

func Map[T, V any](ts []T, fn func(T) V) []V

func Or

func Or(left string, right int) int

func Remove

func Remove[T any](slice []T, s int) []T

Removes an index from a slice

func RenameFolder

func RenameFolder(folder string, name string)

func Swap

func Swap[T any](slice []T, index1, index2 int) []T

func ToHashFunction

func ToHashFunction(value string) otp.Algorithm

func ToInt

func ToInt(str string) int

Converts the given string to an integer, ignoring any errors

func ValidateSecret

func ValidateSecret(secret string) bool

Kanged from totp module

func Validator

func Validator(input textinput.Model, function textinput.ValidateFunc) textinput.Model

Adds a validator function to the given input box

func ValidatorInteger

func ValidatorInteger(input textinput.Model) textinput.Model

Validator for checking the value is an integer

func ValidatorIntegerNo0

func ValidatorIntegerNo0(input textinput.Model) textinput.Model

Validator for checking the value is an integer and doesnt not allow zero

Types

This section is empty.

Jump to

Keyboard shortcuts

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