utils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package utils contains helpers and reusable code for other packages

Index

Constants

View Source
const (
	// Name library name, koazee
	Name = "Koazee"
)

Variables

View Source
var ArrayBool = []bool{true, false, true, false, false}

ArrayBool elements

View Source
var ArrayBoolPtr = []*bool{&ArrayBool[0], &ArrayBool[1], &ArrayBool[2], &ArrayBool[3], &ArrayBool[4]}

ArrayBoolPtr elements

View Source
var ArrayFloat32 = []float32{1.00, 2.25, 3.23, 4.12, 5.20}

ArrayFloat32 elements

View Source
var ArrayFloat32Ptr = []*float32{&ArrayFloat32[0], &ArrayFloat32[1], &ArrayFloat32[2], &ArrayFloat32[3],
	&ArrayFloat32[4]}

ArrayFloat32Ptr elements

View Source
var ArrayFloat64 = []float64{1.00, 2.25, 3.23, 4.12, 5.20}

ArrayFloat64 elements

View Source
var ArrayFloat64Ptr = []*float64{&ArrayFloat64[0], &ArrayFloat64[1], &ArrayFloat64[2], &ArrayFloat64[3],
	&ArrayFloat64[4]}

ArrayFloat64Ptr elements

View Source
var ArrayInt = []int{1, 2, 3, 4, 5}

ArrayInt elements

View Source
var ArrayInt16 = []int16{1, 2, 3, 4, 5}

ArrayInt16 elements

View Source
var ArrayInt16Ptr = []*int16{&ArrayInt16[0], &ArrayInt16[1], &ArrayInt16[2], &ArrayInt16[3], &ArrayInt16[4]}

ArrayInt16Ptr elements

View Source
var ArrayInt32 = []int32{1, 2, 3, 4, 5}

ArrayInt32 elements

View Source
var ArrayInt32Ptr = []*int32{&ArrayInt32[0], &ArrayInt32[1], &ArrayInt32[2], &ArrayInt32[3], &ArrayInt32[4]}

ArrayInt32Ptr elements

View Source
var ArrayInt64 = []int64{1, 2, 3, 4, 5}

ArrayInt64 elements

View Source
var ArrayInt64Ptr = []*int64{&ArrayInt64[0], &ArrayInt64[1], &ArrayInt64[2], &ArrayInt64[3], &ArrayInt64[4]}

ArrayInt64Ptr elements

View Source
var ArrayInt8 = []int8{1, 2, 3, 4, 5}

ArrayInt8 elements

View Source
var ArrayInt8Ptr = []*int8{&ArrayInt8[0], &ArrayInt8[1], &ArrayInt8[2], &ArrayInt8[3], &ArrayInt8[4]}

ArrayInt8Ptr elements

View Source
var ArrayIntPtr = []*int{&ArrayInt[0], &ArrayInt[1], &ArrayInt[2], &ArrayInt[3], &ArrayInt[4]}

ArrayIntPtr elements

View Source
var ArrayString = []string{"Home", "Freedom", "Life", "Monkey", "Happy"}

ArrayString elements

View Source
var ArrayStringPtr = []*string{&ArrayString[0], &ArrayString[1], &ArrayString[2], &ArrayString[3],
	&ArrayString[4]}

ArrayStringPtr elements

View Source
var ArrayUint = []uint{1, 2, 3, 4, 5}

ArrayUint elements

View Source
var ArrayUint16 = []uint16{1, 2, 3, 4, 5}

ArrayUint16 elements

View Source
var ArrayUint16Ptr = []*uint16{&ArrayUint16[0], &ArrayUint16[1], &ArrayUint16[2], &ArrayUint16[3],
	&ArrayUint16[4]}

ArrayUint16Ptr elements

View Source
var ArrayUint32 = []uint32{1, 2, 3, 4, 5}

ArrayUint32 elements

View Source
var ArrayUint32Ptr = []*uint32{&ArrayUint32[0], &ArrayUint32[1], &ArrayUint32[2], &ArrayUint32[3],
	&ArrayUint32[4]}

ArrayUint32Ptr elements

View Source
var ArrayUint64 = []uint64{1, 2, 3, 4, 5}

ArrayUint64 elements

View Source
var ArrayUint64Ptr = []*uint64{&ArrayUint64[0], &ArrayUint64[1], &ArrayUint64[2], &ArrayUint64[3],
	&ArrayUint64[4]}

ArrayUint64Ptr elements

View Source
var ArrayUint8 = []uint8{1, 2, 3, 4, 5}

ArrayUint8 elements

View Source
var ArrayUint8Ptr = []*uint8{&ArrayUint8[0], &ArrayUint8[1], &ArrayUint8[2], &ArrayUint8[3], &ArrayUint8[4]}

ArrayUint8Ptr elements

View Source
var ArrayUintPtr = []*uint{&ArrayUint[0], &ArrayUint[1], &ArrayUint[2], &ArrayUint[3], &ArrayUint[4]}

ArrayUintPtr elements

View Source
var ValueBool = true

ValueBool value

View Source
var ValueBoolPtr = &ValueBool

ValueBoolPtr value

View Source
var ValueFloat32 = float32(100.23)

ValueFloat32 value

View Source
var ValueFloat32Ptr = &ValueFloat32

ValueFloat32Ptr value

View Source
var ValueFloat64 = float64(200.45)

ValueFloat64 value

View Source
var ValueFloat64Ptr = &ValueFloat64

ValueFloat64Ptr value

View Source
var ValueInt = int(6)

ValueInt value

View Source
var ValueInt16 = int16(6)

ValueInt16 value

View Source
var ValueInt16Ptr = &ValueInt16

ValueInt16Ptr value

View Source
var ValueInt32 = int32(6)

ValueInt32 value

View Source
var ValueInt32Ptr = &ValueInt32

ValueInt32Ptr value

View Source
var ValueInt64 = int64(6)

ValueInt64 value

View Source
var ValueInt64Ptr = &ValueInt64

ValueInt64Ptr value

View Source
var ValueInt8 = int8(6)

ValueInt8 value

View Source
var ValueInt8Ptr = &ValueInt8

ValueInt8Ptr value

View Source
var ValueIntPtr = &ValueInt

ValueIntPtr value

View Source
var ValueString = "Bye"

ValueString value

View Source
var ValueStringPtr = &ValueString

ValueStringPtr value

View Source
var ValueUint = uint(6)

ValueUint value

View Source
var ValueUint16 = uint16(6)

ValueUint16 value

View Source
var ValueUint16Ptr = &ValueUint16

ValueUint16Ptr value

View Source
var ValueUint32 = uint32(6)

ValueUint32 value

View Source
var ValueUint32Ptr = &ValueUint32

ValueUint32Ptr value

View Source
var ValueUint64 = uint64(6)

ValueUint64 value

View Source
var ValueUint64Ptr = &ValueUint64

ValueUint64Ptr value

View Source
var ValueUint8 = uint8(6)

ValueUint8 value

View Source
var ValueUint8Ptr = &ValueUint8

ValueUint8Ptr value

View Source
var ValueUintPtr = &ValueUint

ValueUintPtr value

Functions

func Bool

func Bool(value reflect.Value) bool

Bool converts value to bool

func Float32

func Float32(value reflect.Value) float32

Float32 converts value to float32

func Float64

func Float64(value reflect.Value) float64

Float64 converts value to Float64

func Int

func Int(value reflect.Value) int

Int converts value to int

func Int16

func Int16(value reflect.Value) int16

Int16 converts value to int16

func Int32

func Int32(value reflect.Value) int32

Int32 converts value to int32

func Int64

func Int64(value reflect.Value) int64

Int64 converts value to int64

func Int8

func Int8(value reflect.Value) int8

Int8 converts value to int8

func IntPtr

func IntPtr(value int) *int

IntPtr convert an int value into an int pointer

func String

func String(value reflect.Value) string

String converts value to string

Types

type Person

type Person struct {
	FirstName string
	LastName  string
	Age       int
	Male      bool
}

Person struct used by tests

type StreamType

type StreamType int

StreamType struct used to classify the types

const (
	// Unsupported used for those cases in which koazee can not work with
	Unsupported StreamType = iota
	// NatureArray type for any arrays
	NatureArray
)

func NatureOf

func NatureOf(data interface{}) StreamType

NatureOf returns a StreamType for the given parameter.

Jump to

Keyboard shortcuts

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