utils

package
v0.3.15-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IListDeleteByElement

func IListDeleteByElement(input []int, el int) []int

func IListFindElement

func IListFindElement(input []int, el int) int

func IListInsertAfter

func IListInsertAfter(input []int, pos int, els ...int) []int

func IntMax

func IntMax(a int, b int) int

func IntMin

func IntMin(a int, b int) int

func Reflect_TypeIndirect

func Reflect_TypeIndirect(t reflect.Type) reflect.Type

func Reflect_TypePtrWrap

func Reflect_TypePtrWrap(t reflect.Type) reflect.Type

func SListDeleteByElement

func SListDeleteByElement(input []string, el string) []string

func SListDeleteByIndex

func SListDeleteByIndex(input []string, elIndex int) []string

func SListFindElement

func SListFindElement(input []string, el string) int

func SListInsertAfter

func SListInsertAfter(input []string, pos int, els ...string) []string

func SListInsertBefore

func SListInsertBefore(input []string, pos int, els ...string) []string

func Text_CliTwoColumns

func Text_CliTwoColumns(entries [][2]string) string

func Text_FixedLength

func Text_FixedLength(content string, suffix rune, length uint) (string, bool)

func Text_GetWidth

func Text_GetWidth(content string) uint

func Text_LeftColumn

func Text_LeftColumn(column string, content string, gap string, fillEveryLine bool) string

func Text_LeftWrapper

func Text_LeftWrapper(title string, content string, config Text_WrapperOption) string

func Text_Random

func Text_Random(n int) string

func Text_StartWith

func Text_StartWith(content string, prefix string) bool

func Text_fillIfEmpty

func Text_fillIfEmpty(val string, emptyVal string, trimSpace bool) string

func Text_toBool

func Text_toBool(val string) (result bool, err error)

func UIntToBytes

func UIntToBytes(n uint64, b byte) ([]byte, error)

Types

type Text_WrapperOption

type Text_WrapperOption struct {
	Char_LeftTop    rune
	Char_LeftMain   rune
	Char_LeftBottom rune
	Char_BottomMain rune

	Indent_Title   uint
	Indent_Content uint
}

func (Text_WrapperOption) IndentWidth_Content

func (wo Text_WrapperOption) IndentWidth_Content() uint

func (Text_WrapperOption) IndentWidth_Title

func (wo Text_WrapperOption) IndentWidth_Title() uint

Jump to

Keyboard shortcuts

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