fu

package
v0.0.0-...-f9355b5 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllStrOptions

func AllStrOptions(o []interface{}, t ...interface{}) []string

func AsMap

func AsMap(s interface{}) map[string]reflect.Value

func BoolOption

func BoolOption(t interface{}, o []interface{}) bool

func Contains

func Contains(cont interface{}, val interface{}) bool

func CopySlice

func CopySlice(a interface{}) interface{}

CopySlice returns copy of given slice

func Errorf

func Errorf(f string, a ...interface{}) error

func Etrace

func Etrace(err error) error

func FieldsOf

func FieldsOf(s interface{}) []string

func FloatOption

func FloatOption(t interface{}, o []interface{}) float64

func Fnz

func Fnz(a ...interface{}) interface{}

Fnz returns the first non zero value

func Fnzb

func Fnzb(e ...bool) bool

Fnzb returns the first non false bool

func Fnzd

func Fnzd(a ...float64) float64

Fnzd returns the first non zero double value

func Fnze

func Fnze(e ...error) error

Fnze returns the first non nil error

func Fnzi

func Fnzi(a ...int) int

Fnzi returns the first non integer zero value

func Fnzl

func Fnzl(a ...int64) int64

Fnzl returns the first non zero long integer value

func Fnzr

func Fnzr(a ...float32) float32

Fnzr returns the first non zero float value

func Fnzs

func Fnzs(e ...string) string

Fnzs returns the first non empty string

func Ife

func Ife(expr bool, x interface{}, y interface{}) interface{}

Ife returns x if expr == true else returns y

func Ifed

func Ifed(expr bool, x float64, y float64) float64

Ifed returns x if expr == true else returns y

func Ifei

func Ifei(expr bool, x int, y int) int

Ifei returns x if expr == true else returns y

func Ifel

func Ifel(expr bool, x int64, y int64) int64

Ifel returns x if expr == true else returns y

func Ifer

func Ifer(expr bool, x float32, y float32) float32

Ifer returns x if expr == true else returns y

func Ifes

func Ifes(expr bool, x string, y string) string

Ifes returns x if expr == true else returns y

func IfsOption

func IfsOption(t interface{}, o []interface{}) interface{}

func IndexOf

func IndexOf(a string, b []string) int

func IndexOfMax

func IndexOfMax(a interface{}) int

IndexOfMax returns index of maximal value

func IndexOfMin

func IndexOfMin(a interface{}) int

IndexOfMin returns index of minimal value

func IntOption

func IntOption(t interface{}, o []interface{}) int

func KeysOf

func KeysOf(m interface{}) interface{}

KeysOf returns list of keys of a map

func Less

func Less(a, b reflect.Value) bool

Less compares two values and returns true if the left value is less than right one otherwise it returns false

func MapInterface

func MapInterface(m map[string]reflect.Value) map[string]interface{}

func Max

func Max(a ...interface{}) interface{}

Max returns maximal value

func MaxIndex

func MaxIndex(a reflect.Value) int

MaxIndex returns index of maximal value

func MaxValue

func MaxValue(a reflect.Value) reflect.Value

MaxValue returns maximal value

func Maxd

func Maxd(a float64, b ...float64) float64

Maxd returns maximal float64 value

func Maxi

func Maxi(a int, b ...int) int

Maxi returns maximal int value

func Maxr

func Maxr(a float32, b ...float32) float32

Maxr returns maximal float32 value

func Min

func Min(a ...interface{}) interface{}

Min returns minimal value

func MinIndex

func MinIndex(a reflect.Value) int

MinIndex returns index of minimal value

func MinValue

func MinValue(a reflect.Value) reflect.Value

MaxValue returns maximal value

func Mind

func Mind(a float64, b ...float64) float64

Mind returns minimal float32 value

func Mini

func Mini(a int, b ...int) int

Mini returns minimal int value

func Minr

func Minr(a float32, b ...float32) float32

Minr returns minimal float32 value

func MultiOption

func MultiOption(o []interface{}, t ...interface{}) (reflect.Value, int)

func Option

func Option(t interface{}, o interface{}) reflect.Value

func Panic

func Panic(err error) interface{}

func Reverse

func Reverse(slice interface{})

func Reversed

func Reversed(slice interface{}) interface{}

func Round32

func Round32(v float32, n int) float32

func Round64

func Round64(v float64, n int) float64

func RuneOption

func RuneOption(t interface{}, o []interface{}) rune

func Sort

func Sort(a interface{})

func Sorted

func Sorted(a interface{}) interface{}

func SortedKeysOf

func SortedKeysOf(m interface{}) interface{}

SortedKeysOf returns sorted list of keys of a map

func StrMultiOption

func StrMultiOption(o []interface{}, t ...interface{}) (string, int)

func StrOption

func StrOption(t interface{}, o []interface{}) string

func Strings

func Strings(m interface{}) (r []string)

func ValsOf

func ValsOf(m interface{}) interface{}

Types

type Lexic

type Lexic []func(string) bool

func (Lexic) Accepted

func (lx Lexic) Accepted(s string, dflt ...bool) bool

type NaiveRandom

type NaiveRandom struct {
	Value uint32
}

func (*NaiveRandom) Float

func (nr *NaiveRandom) Float() float64

func (*NaiveRandom) Reseed

func (nr *NaiveRandom) Reseed()

func (*NaiveRandom) Uint

func (nr *NaiveRandom) Uint() uint

Jump to

Keyboard shortcuts

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