conditional

package
v1.3.15 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyFunctions added in v0.5.6

func AnyFunctions(
	isTrue bool,
	trueValueFunctions, falseValueFunctions []func() (
		result interface{},
		isTake,
		isBreak bool,
	),
) []func() (
	result interface{},
	isTake,
	isBreak bool,
)

func AnyFunctionsExecuteResults added in v0.5.6

func AnyFunctionsExecuteResults(
	isTrue bool,
	trueValueFunctions, falseValueFunctions []func() (
		result interface{},
		isTake,
		isBreak bool,
	),
) []interface{}

func Bool

func Bool(
	isTrue bool,
	trueValue, falseValue bool,
) bool

func BoolByOrder added in v0.4.1

func BoolByOrder(
	booleans ...bool,
) bool

BoolByOrder returns the first boolean which is true

func BoolFunc added in v0.3.8

func BoolFunc(
	isTrue bool,
	trueValueFunc, falseValueFunc func() bool,
) bool

func BoolFunctionsByOrder added in v0.4.1

func BoolFunctionsByOrder(
	boolFunctions ...func() bool,
) bool

BoolFunctionsByOrder returns the first func which is true and don't execute others.

func BooleanTrueFunc added in v0.9.0

func BooleanTrueFunc(
	isTrue bool,
	trueValueFunc func() bool,
) bool

func Booleans added in v0.3.8

func Booleans(
	isTrue bool,
	trueValue, falseValue []bool,
) []bool

func BooleansPtr added in v0.3.8

func BooleansPtr(
	isTrue bool,
	trueValue, falseValue *[]bool,
) *[]bool

func Byte

func Byte(
	isTrue bool,
	trueValue, falseValue byte,
) byte

func Bytes added in v0.0.8

func Bytes(
	isTrue bool,
	trueValue, falseValue []byte,
) []byte

func BytesPtr added in v0.0.8

func BytesPtr(
	isTrue bool,
	trueValue, falseValue *[]byte,
) *[]byte

func BytesTrueFunc added in v0.9.0

func BytesTrueFunc(
	isTrue bool,
	trueValueFunc func() []byte,
) []byte

func DefOnNil added in v0.5.6

func DefOnNil(
	canBeEmpty interface{},
	onNonNil interface{},
) interface{}

func ErrorFunc added in v0.5.6

func ErrorFunc(
	isTrue bool,
	trueValueFunction func() error,
	falseValueFunction func() error,
) func() error

ErrorFunc returns func based on condition

func ErrorFunctionResult added in v0.5.6

func ErrorFunctionResult(
	isTrue bool,
	trueValueFunction func() error,
	falseValueFunction func() error,
) error

ErrorFunctionResult execute error function based on condition and returns final error

func ErrorFunctionsExecuteResults added in v0.5.6

func ErrorFunctionsExecuteResults(
	isTrue bool,
	trueValueFunctions []func() error,
	falseValueFunctions []func() error,
) error

ErrorFunctionsExecuteResults execute error functions based on condition and returns final error

func Func added in v0.3.8

func Func(
	isTrue bool,
	trueValueFunc, falseValueFunc func() interface{},
) func() interface{}

func Int

func Int(
	isTrue bool,
	trueValue, falseValue int,
) int

func Integers added in v0.3.8

func Integers(
	isTrue bool,
	trueValue, falseValue []int,
) []int

func IntegersPtr added in v0.3.8

func IntegersPtr(
	isTrue bool,
	trueValue, falseValue *[]int,
) *[]int

func IntegersPtrFunc added in v0.3.8

func IntegersPtrFunc(
	isTrue bool,
	trueValueFunc, falseValueFunc func() *[]int,
) *[]int

func Interface

func Interface(
	isTrue bool,
	trueValue, falseValue interface{},
) interface{}

func InterfaceFunc added in v0.3.8

func InterfaceFunc(
	isTrue bool,
	trueValueFunc, falseValueFunc func() interface{},
) interface{}

func Interfaces added in v0.0.8

func Interfaces(
	isTrue bool,
	trueValue, falseValue []interface{},
) []interface{}

func InterfacesPtr added in v0.0.8

func InterfacesPtr(
	isTrue bool,
	trueValue, falseValue *[]interface{},
) *[]interface{}

func NilBoolVal added in v0.5.6

func NilBoolVal(
	valuePointer *bool,
	defVal bool,
) bool

func NilBoolValPtr added in v0.5.6

func NilBoolValPtr(
	valuePointer *bool,
	defVal bool,
) *bool

func NilByteVal added in v0.5.6

func NilByteVal(
	valuePointer *byte,
	defVal byte,
) byte

func NilByteValPtr added in v0.5.6

func NilByteValPtr(
	valuePointer *byte,
	defVal byte,
) *byte

func NilCheck added in v0.5.6

func NilCheck(
	canBeEmpty interface{},
	onNil interface{},
	onNonNil interface{},
) interface{}

func NilDefBool added in v0.5.6

func NilDefBool(
	valuePointer *bool,
) bool

func NilDefBoolPtr added in v0.5.6

func NilDefBoolPtr(
	valuePointer *bool,
) *bool

func NilDefByte added in v0.5.6

func NilDefByte(
	valuePointer *byte,
) byte

func NilDefBytePtr added in v0.5.6

func NilDefBytePtr(
	valuePointer *byte,
) *byte

func NilDefInt added in v0.5.6

func NilDefInt(
	valuePointer *int,
) int

func NilDefIntPtr added in v0.5.6

func NilDefIntPtr(
	valuePointer *int,
) *int

func NilDefStr added in v0.5.6

func NilDefStr(
	strPtr *string,
) string

func NilDefStrPtr added in v0.5.6

func NilDefStrPtr(
	strPtr *string,
) *string

func NilDefValInt added in v0.5.6

func NilDefValInt(
	valuePointer *int,
	defVal int,
) int

func NilOrEmptyStr added in v0.5.6

func NilOrEmptyStr(
	strPtr *string,
	onNilOrEmpty string,
	onNonNilOrNonEmpty string,
) string

func NilOrEmptyStrPtr added in v0.5.6

func NilOrEmptyStrPtr(
	strPtr *string,
	onNilOrEmpty string,
	onNonNilOrNonEmpty string,
) *string

func NilStr added in v0.5.6

func NilStr(
	strPtr *string,
	onNil string,
	onNonNil string,
) string

func Setter added in v0.0.8

func Setter(
	isTrue bool,
	trueValue, falseValue issetter.Value,
) issetter.Value

func SetterDefault added in v0.5.6

func SetterDefault(
	currentSetter issetter.Value,
	defVal issetter.Value,
) issetter.Value

func String

func String(
	isTrue bool,
	trueValue, falseValue string,
) string

func StringDefault added in v0.9.8

func StringDefault(
	isTrue bool,
	trueValue string,
) string

func StringFunc added in v0.3.8

func StringFunc(
	isTrue bool,
	trueValueFunc, falseValueFunc func() string,
) string

func StringPtr

func StringPtr(
	isTrue bool,
	trueValue, falseValue *string,
) *string

func StringTrueFunc added in v0.9.0

func StringTrueFunc(
	isTrue bool,
	trueValueFunc func() string,
) string

func Strings added in v0.0.8

func Strings(
	isTrue bool,
	trueValue, falseValue []string,
) []string

func StringsIndexVal added in v0.5.1

func StringsIndexVal(
	isTrue bool,
	slice []string,
	trueValue, falseValue int,
) string

func StringsPtr added in v0.0.8

func StringsPtr(
	isTrue bool,
	trueValue, falseValue *[]string,
) *[]string

func StringsTrueFunc added in v0.9.0

func StringsTrueFunc(
	isTrue bool,
	trueValueFunc func() []string,
) []string

func VoidFunctions added in v0.5.6

func VoidFunctions(
	isTrue bool,
	trueValueFunctions []func(),
	falseValueFunctions []func(),
)

VoidFunctions execute void functions based on condition

Types

This section is empty.

Jump to

Keyboard shortcuts

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