converters

package
v1.3.55 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 17 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StringsTo = stringsTo{}
	Any       = anyItemConverter{}
)

Functions

func AnyToValueString added in v0.8.1

func AnyToValueString(anyItem interface{}) string

func BytesPointerToBytes added in v1.1.0

func BytesPointerToBytes(fromBytesPointer *[]byte) []byte

func BytesPtrToString added in v1.3.24

func BytesPtrToString(
	rawBytes *[]byte,
) string

func BytesToString added in v1.3.24

func BytesToString(
	rawBytes []byte,
) string

func CloneMapStringStringPlusAppendMapStringAny added in v0.8.3

func CloneMapStringStringPlusAppendMapStringAny(
	isSkipEmpty bool,
	mainMap map[string]interface{},
	additionalMapItems map[string]interface{},
) map[string]string

func IntegersToMap added in v0.3.8

func IntegersToMap(inputArray *[]int) *map[int]bool

func IntegersToStrings added in v1.3.34

func IntegersToStrings(intSlice []int) []string

func JsonBytesFromStringValue added in v0.6.8

func JsonBytesFromStringValue(name string) []byte

func KeysValuesStringsToMap added in v0.1.6

func KeysValuesStringsToMap(keys, values []string) map[string]string

KeysValuesStringsToMap keys nil will return empty map[string]string

func KeysValuesStringsToMapPtr added in v0.8.3

func KeysValuesStringsToMapPtr(keys, values *[]string) *map[string]string

KeysValuesStringsToMapPtr keys nil will return empty map[string]string

func MapStringAnyToMapStringString added in v0.8.3

func MapStringAnyToMapStringString(
	isSkipEmpty bool,
	additionalMapItems map[string]interface{},
) map[string]string

func PointerStringsToStrings

func PointerStringsToStrings(pointerStringOfArray *[]*string) *[]string

PointerStringsToStrings will give empty or converted results array (not nil)

func StringToByte added in v0.3.8

func StringToByte(input string) (byte, error)

func StringToByteWithDefault added in v0.3.8

func StringToByteWithDefault(
	input string, defaultByte byte,
) (value byte, isSuccess bool)

func StringToBytesConditional added in v0.3.8

func StringToBytesConditional(
	stringInput,
	separator string,
	processor func(in string) (out byte, isTake, isBreak bool),
) *[]byte

func StringToFloat64 added in v0.4.1

func StringToFloat64(input string) (value float64, err error)

func StringToFloat64Conditional added in v0.4.1

func StringToFloat64Conditional(
	input string, defaultFloat64 float64,
) (value float64, isSuccess bool)

func StringToFloat64Default added in v0.4.1

func StringToFloat64Default(
	input string, defaultFloat64 float64,
) (value float64, isSuccess bool)

func StringToFloat64Must added in v0.4.1

func StringToFloat64Must(input string) float64

func StringToInteger added in v0.4.1

func StringToInteger(
	input string,
) (value int, err error)

func StringToIntegerDefault added in v0.9.8

func StringToIntegerDefault(
	input string,
) int

func StringToIntegerMust added in v0.4.1

func StringToIntegerMust(
	input string,
) (value int)

func StringToIntegerWithDefault added in v0.3.8

func StringToIntegerWithDefault(
	input string,
	defaultInt int,
) (value int, isSuccess bool)

func StringToIntegersConditional added in v0.4.1

func StringToIntegersConditional(
	stringInput,
	separator string,
	processor func(in string) (out int, isTake, isBreak bool),
) *[]int

func StringToIntegersWithDefaults added in v0.4.1

func StringToIntegersWithDefaults(
	stringInput,
	separator string,
	defaultInt int,
) *coreconverted.Integers

func StringsPointersToStringBoolMap

func StringsPointersToStringBoolMap(inputArray *[]*string) *map[string]bool

func UnsafeBytesPtrToStringPtr added in v0.4.2

func UnsafeBytesPtrToStringPtr(unsafeBytes *[]byte) *string

UnsafeBytesPtrToStringPtr Returns string from unsafe bytes pointer

May panic on conversion if the bytes were not in unsafe pointer.

Expressions: - return (*string)(unsafe.Pointer(allBytes))

func UnsafeBytesToString added in v0.3.8

func UnsafeBytesToString(unsafeBytes []byte) string

func UnsafeBytesToStringPtr added in v0.4.2

func UnsafeBytesToStringPtr(unsafeBytes []byte) *string

func UnsafeBytesToStringWithErr added in v0.4.3

func UnsafeBytesToStringWithErr(unsafeBytes []byte) (string, error)

func UnsafeBytesToStrings

func UnsafeBytesToStrings(unsafeBytes *[]byte) *[]string

UnsafeBytesToStrings

Returns string arrays from unsafe bytes pointer

May panic on conversion if the bytes were not in unsafe pointer.

Expressions: - return (*[] string)(unsafe.Pointer(allBytes))

Types

type StringsToMapConverter added in v1.3.16

type StringsToMapConverter []string

func (*StringsToMapConverter) HasAnyItem added in v1.3.16

func (it *StringsToMapConverter) HasAnyItem() bool

func (*StringsToMapConverter) IsEmpty added in v1.3.16

func (it *StringsToMapConverter) IsEmpty() bool

func (*StringsToMapConverter) LastIndex added in v1.3.16

func (it *StringsToMapConverter) LastIndex() int

func (*StringsToMapConverter) Length added in v1.3.16

func (it *StringsToMapConverter) Length() int

func (StringsToMapConverter) LineProcessorMapOptions added in v1.3.16

func (it StringsToMapConverter) LineProcessorMapOptions(
	isTrimBefore bool,
	processorFunc func(line string) (key, val string),
) map[string]string

func (StringsToMapConverter) LineProcessorMapStringAnyOptions added in v1.3.16

func (it StringsToMapConverter) LineProcessorMapStringAnyOptions(
	isTrimBefore bool,
	processorFunc func(line string) (key string, val interface{}),
) map[string]interface{}

func (StringsToMapConverter) LineProcessorMapStringAnyTrim added in v1.3.16

func (it StringsToMapConverter) LineProcessorMapStringAnyTrim(
	processorFunc func(line string) (key string, val interface{}),
) map[string]interface{}

func (StringsToMapConverter) LineProcessorMapStringIntegerOptions added in v1.3.16

func (it StringsToMapConverter) LineProcessorMapStringIntegerOptions(
	isTrimBefore bool,
	processorFunc func(line string) (key string, val int),
) map[string]int

func (StringsToMapConverter) LineProcessorMapStringIntegerTrim added in v1.3.16

func (it StringsToMapConverter) LineProcessorMapStringIntegerTrim(
	processorFunc func(line string) (key string, val int),
) map[string]int

func (StringsToMapConverter) LineSplitMap added in v1.3.16

func (it StringsToMapConverter) LineSplitMap(
	splitter string,
) map[string]string

func (StringsToMapConverter) LineSplitMapOptions added in v1.3.16

func (it StringsToMapConverter) LineSplitMapOptions(
	isTrim bool,
	splitter string,
) map[string]string

func (StringsToMapConverter) LineSplitMapTrim added in v1.3.16

func (it StringsToMapConverter) LineSplitMapTrim(
	splitter string,
) map[string]string

func (StringsToMapConverter) SafeStrings added in v1.3.16

func (it StringsToMapConverter) SafeStrings() []string

func (StringsToMapConverter) Strings added in v1.3.16

func (it StringsToMapConverter) Strings() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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