mcutils

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 12 Imported by: 0

README

mcutils | github.com/abbeymart/mcutilsgo

  • Shared and common utility functions

Documentation

Index

Constants

View Source
const (
	DefaultLanguage = "en-US"
)

Variables

This section is empty.

Functions

func ArrayContain

func ArrayContain(arr []interface{}, str interface{}) bool

func ArrayContains

func ArrayContains(arr []string, str string) bool

func ArrayIntContains

func ArrayIntContains(arr []int, val int) bool

func ArrayStringContains

func ArrayStringContains(arr []string, val string) bool

func CamelCase

func CamelCase(text string, sep string) (string, error)

func Classify

func Classify()

func ExitOnError

func ExitOnError(err error)

func FactGen

func FactGen(num uint) chan uint

func FactorialGen

func FactorialGen(num uint) uint

func FactorialGen2

func FactorialGen2(num uint) uint

func FactorialTail

func FactorialTail(num uint, acc uint) uint

func FiboArray

func FiboArray(num uint) [][]uint

func FiboSeries

func FiboSeries(num uint) chan<- uint

func FiboTail

func FiboTail(n int, current int, next int) int

func Filter

func Filter(arr []interface{}, filterFunc func(interface{}) bool) []interface{}

func FilterGen

func FilterGen(arr []interface{}, filterFunc func(interface{}) bool, filterChan chan<- interface{})

func GetLanguage

func GetLanguage(userLang string) string

func GetParamsMessage

func GetParamsMessage(msgObject mctypes.MessageObject, msgType string) mcresponse.ResponseMessage

func IsPrime

func IsPrime(n uint) bool

func Knn

func Knn()

func LeapYear

func LeapYear(year int) bool

func Map

func Map(arr []interface{}, mapFunc func(interface{}) interface{}) []interface{}

Collections

func MapGen

func MapGen(arr []interface{}, mapFunc func(interface{}) interface{}, mapChan chan<- interface{})

func MapInt

func MapInt(arr []int, mapFunc func(int) int) []int

func Max

func Max(arr []float64) float64

func Mean

func Mean(arr []float64) float64

func MeanSquareError

func MeanSquareError()

func MeanSquareRootError

func MeanSquareRootError()

func Median

func Median(arr []float64) float64

func Min

func Min(arr []float64) float64

func MinMax

func MinMax(arr []float64) []float64

func NBayes

func NBayes()

func NaturalNumbers

func NaturalNumbers(count uint) chan<- uint

func NaturalNumbersGen

func NaturalNumbersGen(count uint, naturalChan chan<- uint)

Finite natural numbers generation

func NaturalNumbersGenInf

func NaturalNumbersGenInf(naturalChan chan<- uint)

Infinite natural numbers generation

func PanicOnError

func PanicOnError(err error)

func PascalCase

func PascalCase(text string, sep string) (string, error)

func Pythagoras

func Pythagoras(limit uint) [][]uint

func PythagorasGen

func PythagorasGen(limit uint, pythagorasChan chan []uint)

func ReverseArray

func ReverseArray(arr []interface{}) []interface{}

func ReverseArrayFloat

func ReverseArrayFloat(arr []float64) []float64

func ReverseArrayFloatGen

func ReverseArrayFloatGen(arr []float64, arrChan chan float64)

func ReverseArrayGen

func ReverseArrayGen(arr []interface{}, arrChan chan interface{})

func ReverseArrayInt

func ReverseArrayInt(arr []int) []int

func ReverseArrayIntGen

func ReverseArrayIntGen(arr []int, arrChan chan int)

func ShortString

func ShortString(str string, maxLength uint) string

func StandardDeviation

func StandardDeviation(arr []float64) float64

func StringToBool

func StringToBool(val string) bool

func Take

func Take(num uint, arr []interface{}) chan<- interface{}

func TakeGen

func TakeGen(num uint, arr []interface{}, takeChan chan<- interface{})

func Variance

func Variance()

Types

type ArrayOfFloat

type ArrayOfFloat []float64

type ArrayOfInt

type ArrayOfInt []int

type ArrayOfString

type ArrayOfString []string

type ArrayValue

type ArrayValue []interface{}

counter

type DataCount

type DataCount map[string]int

type Locale

type Locale map[string]LocaleContent

type LocaleContent

type LocaleContent map[string]interface{}

type LocaleOptions

type LocaleOptions struct {
	LocaleType string
	Language   string
}

type MessageObject

type MessageObject map[string]string

Jump to

Keyboard shortcuts

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