clio

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDigit

func HasDigit(s string) error

func HasUppercase

func HasUppercase(s string) error

func IsEmail

func IsEmail(s string) error

func IsInteger

func IsInteger(s string) error

func IsNumeric

func IsNumeric(s string) error

func NotEmpty

func NotEmpty(s string) error

Types

type Choice

type Choice struct {
	Label string
	Value string
}

type Clio

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

func NewClio

func NewClio() *Clio

func (*Clio) Ask

func (c *Clio) Ask(question string, validate ValidatorFn) string

func (*Clio) AskHidden

func (c *Clio) AskHidden(question string, validate ValidatorFn) (string, error)

func (*Clio) Banner added in v1.1.0

func (c *Clio) Banner()

func (*Clio) Confirm

func (c *Clio) Confirm(question string, defaultVal bool) bool

func (*Clio) Debug

func (c *Clio) Debug(format string, args ...any)

func (*Clio) Error

func (c *Clio) Error(format string, args ...any)

func (*Clio) Fatal

func (c *Clio) Fatal(format string, args ...any)

func (*Clio) Info

func (c *Clio) Info(format string, args ...any)

func (*Clio) List

func (c *Clio) List(title string, elements []string)

func (*Clio) MultipleChoice

func (c *Clio) MultipleChoice(question string, choices []Choice) string

func (*Clio) PickInRange

func (c *Clio) PickInRange(min, max int) int

func (*Clio) SetBanner added in v1.2.0

func (c *Clio) SetBanner(template string, values ...any)

func (*Clio) Success

func (c *Clio) Success(format string, args ...any)

func (*Clio) Warn

func (c *Clio) Warn(format string, args ...any)

type ValidatorFn

type ValidatorFn func(string) error

func Between

func Between(min, max float64) ValidatorFn

func Chain

func Chain(validators ...ValidatorFn) ValidatorFn

func GreaterThan

func GreaterThan(min float64) ValidatorFn

func LessThan

func LessThan(max float64) ValidatorFn

func Matches

func Matches(pattern string) ValidatorFn

func MaxLength

func MaxLength(max int) ValidatorFn

func MinLength

func MinLength(min int) ValidatorFn

Jump to

Keyboard shortcuts

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