common

package
v0.0.0-...-284a013 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func FormatCommas

func FormatCommas(v int64) string

FormatCommas returns number in a comma delimited format.

func PadLft

func PadLft(v interface{}, length int) string

PadLft returns left-padded string for a given length.

func PadRgt

func PadRgt(v interface{}, length int) string

PadRgt returns right-padded string for a given length.

func TruncStr

func TruncStr(v string, length int) string

TruncStr returns truncated string with ellipses.

func WidgetActiveStyle

func WidgetActiveStyle() ui.Style

WidgetActiveStyle returns new termui style instance.

func WidgetBorderStyle

func WidgetBorderStyle() ui.Style

WidgetBorderStyle returns new termui style instance.

func WidgetDefaultStyle

func WidgetDefaultStyle() ui.Style

WidgetDefaultStyle returns new termui style instance.

func WidgetTitleStyle

func WidgetTitleStyle() ui.Style

WidgetTitleStyle returns new termui style instance.

Types

type Currency

type Currency struct {
	Code   string
	Symbol string
}

Currency declared data types.

func NewCurrency

func NewCurrency(code string) *Currency

NewCurrency creates a new currency instance.

func (*Currency) Format

func (currency *Currency) Format(v float64, precision int) string

Format returns formatted currency value.

func (*Currency) IsValid

func (currency *Currency) IsValid() bool

IsValid checks the currency code is supported.

type EndpointInterface

type EndpointInterface interface {
	URI() string
	Params() []string
	Parse(body []byte) interface{}
}

EndpointInterface provides runtime methods.

type Language

type Language struct {
	Code string
	// contains filtered or unexported fields
}

Language declared data types.

func NewLanguage

func NewLanguage(locale string) *Language

NewLanguage creates a new language instance.

func (*Language) IsValid

func (language *Language) IsValid() bool

IsValid checks the language code is supported.

func (*Language) Translate

func (language *Language) Translate(key string) string

Translate returns translated text value.

type ServiceInterface

type ServiceInterface interface {
	URL(endpointName string) string
	Params(endpointName string) []string
	Parse(endpointName string, body []byte) interface{}
}

ServiceInterface provides runtime methods.

type Widget

type Widget struct {
	Title  string
	Left   int
	Top    int
	Right  int
	Bottom int
}

Widget declared data types.

type WidgetAction

type WidgetAction func()

WidgetAction declared function.

type WidgetEvent

type WidgetEvent func(e ui.Event)

WidgetEvent declared function.

Jump to

Keyboard shortcuts

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