typeUtils

package
v0.0.3-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToInt64

func BytesToInt64(bytes []byte) uint64

func BytesToUInt64

func BytesToUInt64(bytes []byte) uint64

func Error_FailedToParse_MapItem

func Error_FailedToParse_MapItem(key string, reason interface{}) error

func Error_FailedToParse_MapKey

func Error_FailedToParse_MapKey(key interface{}, reason interface{}) error

func Error_FailedToParse_SliceItem

func Error_FailedToParse_SliceItem(position interface{}, reason interface{}) error

func Error_Mismatched_Format

func Error_Mismatched_Format(expected, got string) error

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 InterfaceToInterfaceSlice

func InterfaceToInterfaceSlice(input interface{}) ([]interface{}, error)

func InterfaceToStringMap

func InterfaceToStringMap(input interface{}) (map[string]string, error)

func InterfaceToStringSlice

func InterfaceToStringSlice(input interface{}, option SliceOpt) ([]string, error)

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 SliceOpt

type SliceOpt uint8
const (
	TypeString_Split SliceOpt = 1 << (8 - 1 - iota) // split string into slice by ','
	TypeString_Warp                                 // warp string as [1]string
	TypeString_Error                                // throw error when trying to parse string
)

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