strtype

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 28 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CurlyStringWrapFormat                                = "{%s}"
	BracketStringWrapFormat                              = "[%s]"
	TitleValueQuotationParenthesisRefWrapReferenceFormat = "%s: %q (%s)" // Title, QuotationValue, Reference string
	TitleBracketWrapFormat                               = "%s: [%s]"    // Title, Value - (value bracket wrapped)
	TitleCurlyWrapFormat                                 = "%s: {%s}"    // Title, Value - (value curly wrapped)
	TitleQuotationWrapFormat                             = "%s: %q"      // Title, Value - (value Quotation wrapped)
)

Variables

View Source
var (

	// Arch
	// Current OS architecture
	Arch  = osarchs.CurrentArch
	Group = ostype.CurrentGroupVariant.Group
	// Type Current Os Type
	Type = ostype.CurrentGroupVariant
)

Functions

This section is empty.

Types

type FileReader added in v0.1.3

type FileReader interface {
	FilePath() string

	OpenFile() (*os.File, error)
	OpenFileLock() (*os.File, error)

	Type() (Variant, error)
	TypeLock() (Variant, error)

	TrimText() (string, error)
	TrimTextLock() (string, error)

	TrimLine() (string, error)
	TrimLineLock() (string, error)

	Line() (string, error)
	LineLock() (string, error)

	Text() (string, error)
	TextLock() (string, error)

	String() (string, error)
	StringLock() (string, error)

	Strings() ([]string, error)
	StringsLock() ([]string, error)

	SimpleSlice() (*corestr.SimpleSlice, error)
	SimpleSliceLock() (*corestr.SimpleSlice, error)

	Lines() ([]string, error)
	LinesLock() ([]string, error)

	NonEmptyLines() ([]string, error)
	NonEmptyLinesLock() ([]string, error)

	TrimNonEmptyLines() ([]string, error)
	TrimNonEmptyLinesLock() ([]string, error)

	TrimNonWhitespaceLines() ([]string, error)
	TrimNonWhitespaceLinesLock() ([]string, error)

	Bytes() ([]byte, error)
	BytesLock() ([]byte, error)

	Raw() ([]byte, error)
	RawLock() ([]byte, error)

	JsonResult() (*corejson.Result, error)
	JsonResultLock() (*corejson.Result, error)

	RawAsJsonResult() *corejson.Result
	RawAsJsonResultLock() *corejson.Result
}

func NewFileReader added in v0.1.3

func NewFileReader(filePath string) FileReader

type Variant

type Variant string

func GetSet

func GetSet(
	isCondition bool,
	trueValue Variant,
	falseValue Variant,
) Variant

func GetSetVariant

func GetSetVariant(
	isCondition bool,
	trueValue byte,
	falseValue byte,
) Variant

func New added in v0.0.4

func New(val string) Variant

func NewUsingEnum added in v0.1.3

func NewUsingEnum(valueEnum enuminf.BasicEnumer) Variant

func NewUsingInteger added in v0.1.3

func NewUsingInteger(valueInteger int) Variant

func NewUsingJsonResult added in v0.1.3

func NewUsingJsonResult(jsonResult *corejson.Result) Variant

func NewUsingJsoner added in v0.1.3

func NewUsingJsoner(jsoner corejson.Jsoner) Variant

func NewUsingStringer added in v0.1.3

func NewUsingStringer(valueStringer fmt.Stringer) Variant

func (Variant) Add

func (it Variant) Add(n string) Variant

Add v + n

func (Variant) AddAnother added in v0.0.4

func (it Variant) AddAnother(n Variant) Variant

func (Variant) AddPrefixOnMissing added in v0.2.7

func (it Variant) AddPrefixOnMissing(
	prefix string,
) (compiled string)

func (Variant) AddSuffixOnMissing added in v0.2.7

func (it Variant) AddSuffixOnMissing(
	suffixAdd string,
) (compiled string)

func (Variant) AllChars added in v0.0.4

func (it Variant) AllChars() []byte

func (Variant) AllNameValues added in v0.0.4

func (it Variant) AllNameValues() []string

func (Variant) AllRunes added in v0.0.4

func (it Variant) AllRunes() []rune

func (Variant) AndHasElement added in v0.1.3

func (it Variant) AndHasElement(n Variant) bool

func (Variant) AndIsEmpty added in v0.1.3

func (it Variant) AndIsEmpty(n Variant) bool

func (Variant) Append added in v0.1.3

func (it Variant) Append(n Variant) Variant

func (Variant) AppendIf added in v0.1.3

func (it Variant) AppendIf(isAppend bool, n Variant) Variant

func (Variant) AppendStringIf added in v0.1.3

func (it Variant) AppendStringIf(isAppend bool, n string) Variant

func (Variant) AsBasicEnumer added in v0.0.4

func (it Variant) AsBasicEnumer() enuminf.BasicEnumer

func (Variant) ByteType added in v0.2.8

func (it Variant) ByteType() (val bytetype.Variant, isValid bool)

func (Variant) ConvInteger added in v0.1.3

func (it Variant) ConvInteger() (int, error)

func (Variant) Count added in v0.0.4

func (it Variant) Count() int

func (Variant) CurlyWrap added in v0.0.4

func (it Variant) CurlyWrap() string

func (Variant) EnumType added in v0.0.4

func (it Variant) EnumType() enuminf.EnumTyper

func (Variant) FileReader added in v0.1.3

func (it Variant) FileReader() FileReader

func (Variant) Format added in v0.0.4

func (it Variant) Format(format string) (compiled string)

func (Variant) HasAnyItem added in v0.1.3

func (it Variant) HasAnyItem() bool

func (Variant) HasInAliasMap added in v0.1.3

func (it Variant) HasInAliasMap(givenMap map[string]Variant, checkingElement Variant) bool

func (Variant) HasPrefix added in v0.1.3

func (it Variant) HasPrefix(n string) bool

func (Variant) HasSuffix added in v0.1.3

func (it Variant) HasSuffix(n string) bool

func (Variant) Index added in v0.1.3

func (it Variant) Index(n string) int

func (Variant) IntType added in v0.1.3

func (it Variant) IntType() inttype.Variant

func (Variant) Integer added in v0.1.3

func (it Variant) Integer() int

func (Variant) IntegerDefaultVal added in v0.1.3

func (it Variant) IntegerDefaultVal(defaultVal int) (valueInt int, isSuccess bool)

func (Variant) IntegerEnumRanges added in v0.0.4

func (it Variant) IntegerEnumRanges() []int

func (Variant) Is

func (it Variant) Is(n Variant) bool

func (Variant) IsAnyNamesOf added in v0.0.4

func (it Variant) IsAnyNamesOf(names ...string) bool

func (Variant) IsCompareResult

func (it Variant) IsCompareResult(n string, compare corecomparator.Compare) bool

IsCompareResult Here left is v, and right is `n`

func (Variant) IsContains added in v0.1.3

func (it Variant) IsContains(n string) bool

func (Variant) IsDefined added in v0.0.4

func (it Variant) IsDefined() bool

func (Variant) IsEmpty added in v0.0.4

func (it Variant) IsEmpty() bool

func (Variant) IsEndsWith added in v0.1.3

func (it Variant) IsEndsWith(n string) bool

func (Variant) IsEqual

func (it Variant) IsEqual(n string) bool

func (Variant) IsEqualAnother added in v0.0.4

func (it Variant) IsEqualAnother(n Variant) bool

func (Variant) IsEqualTrim added in v0.0.4

func (it Variant) IsEqualTrim(right string) bool

func (Variant) IsGreater

func (it Variant) IsGreater(n string) bool

IsGreater v.Value() > n

func (Variant) IsGreaterEqual

func (it Variant) IsGreaterEqual(n string) bool

IsGreaterEqual v.Value() >= n

func (Variant) IsInvalid added in v0.0.4

func (it Variant) IsInvalid() bool

func (Variant) IsLess

func (it Variant) IsLess(n string) bool

IsLess v.Value() < n

func (Variant) IsLessEqual

func (it Variant) IsLessEqual(n string) bool

IsLessEqual v.Value() <= n

func (Variant) IsNameEqual added in v0.0.4

func (it Variant) IsNameEqual(name string) bool

func (Variant) IsStartsWith added in v0.1.3

func (it Variant) IsStartsWith(n string) bool

func (Variant) IsValid added in v0.0.4

func (it Variant) IsValid() bool

func (Variant) IsWhitespace added in v0.0.4

func (it Variant) IsWhitespace() bool

func (Variant) Join added in v0.1.3

func (it Variant) Join(elements ...Variant) Variant

func (Variant) JoinStrings added in v0.1.3

func (it Variant) JoinStrings(elements ...string) Variant

func (Variant) LastIndexOf added in v0.1.3

func (it Variant) LastIndexOf(n string) int

func (Variant) Length added in v0.0.4

func (it Variant) Length() int

func (Variant) MarshalJSON added in v0.0.4

func (it Variant) MarshalJSON() ([]byte, error)

func (Variant) MaxInt added in v0.0.4

func (it Variant) MaxInt() int

func (Variant) MaxValueString added in v0.0.4

func (it Variant) MaxValueString() string

func (Variant) MinInt added in v0.0.4

func (it Variant) MinInt() int

func (Variant) MinMaxAny added in v0.1.3

func (it Variant) MinMaxAny() (min, max interface{})

func (Variant) MinValueString added in v0.0.4

func (it Variant) MinValueString() string

func (Variant) Name added in v0.0.4

func (it Variant) Name() string

func (Variant) NameUsingMap added in v0.0.4

func (it Variant) NameUsingMap(
	nameRanges map[Variant]string,
) string

func (Variant) NameValue added in v0.0.4

func (it Variant) NameValue() string

func (Variant) OnlySupportedErr added in v0.0.4

func (it Variant) OnlySupportedErr(names ...string) error

func (Variant) OnlySupportedMsgErr added in v0.0.4

func (it Variant) OnlySupportedMsgErr(message string, names ...string) error

func (Variant) OrEmpty added in v0.1.3

func (it Variant) OrEmpty(n Variant) bool

func (Variant) OrHasElement added in v0.1.3

func (it Variant) OrHasElement(n Variant) bool

func (Variant) Prepend added in v0.1.3

func (it Variant) Prepend(n Variant) Variant

func (Variant) PrependIf added in v0.1.3

func (it Variant) PrependIf(isPrepend bool, n Variant) Variant

func (Variant) PrependString added in v0.1.3

func (it Variant) PrependString(n string) Variant

func (Variant) PrependStringIf added in v0.1.3

func (it Variant) PrependStringIf(isPrepend bool, n string) Variant

func (Variant) QuotationWrap added in v0.0.4

func (it Variant) QuotationWrap() string

func (Variant) RangeNamesCsv added in v0.0.4

func (it Variant) RangeNamesCsv() string

func (Variant) RangesDynamicMap added in v0.0.4

func (it Variant) RangesDynamicMap() map[string]interface{}

func (Variant) Remove added in v0.0.4

func (it Variant) Remove(
	removeText string,
) Variant

func (Variant) RemoveMany added in v0.0.5

func (it Variant) RemoveMany(
	removeTexts ...string,
) Variant

func (Variant) RemoveManyBySplitting added in v0.0.5

func (it Variant) RemoveManyBySplitting(
	splitsBy string,
	removeTexts ...string,
) []string

func (Variant) Replace added in v0.0.4

func (it Variant) Replace(
	oldText, newText string,
) Variant

func (Variant) ReplaceUsingMapCurly added in v0.0.4

func (it Variant) ReplaceUsingMapCurly(
	replacingMap map[string]string,
) Variant

func (Variant) ReplaceUsingMapDirect added in v0.0.4

func (it Variant) ReplaceUsingMapDirect(
	replacingMap map[string]string,
) Variant

func (Variant) ReplaceUsingMapOption added in v0.0.4

func (it Variant) ReplaceUsingMapOption(
	isWrapKeysWithCurly bool,
	replacingMap map[string]string,
) Variant

func (Variant) RunesLength added in v0.0.4

func (it Variant) RunesLength() (length int, allRunes []rune)

func (Variant) SafeSplit added in v0.0.4

func (it Variant) SafeSplit(
	midPoint int,
) (left, right Variant)

func (Variant) SafeSubString added in v0.0.4

func (it Variant) SafeSubString(
	start, end int,
) Variant

func (Variant) SafeSubStringEnd added in v0.0.4

func (it Variant) SafeSubStringEnd(
	end int,
) Variant

func (Variant) SafeSubStringStart added in v0.0.4

func (it Variant) SafeSubStringStart(
	start int,
) Variant

func (Variant) SimpleStringOnce added in v0.0.4

func (it Variant) SimpleStringOnce(
	isInitialized bool,
) corestr.SimpleStringOnce

func (Variant) Size added in v0.0.4

func (it Variant) Size() int

func (Variant) SplitBy added in v0.0.5

func (it Variant) SplitBy(
	splitsBy string,
) []string

func (Variant) SplitByWhitespace added in v0.0.5

func (it Variant) SplitByWhitespace() []string

func (Variant) SplitKeyVal added in v0.2.7

func (it Variant) SplitKeyVal(
	splitsBy string,
) (key, val string)

func (Variant) SplitKeyValTrim added in v0.2.7

func (it Variant) SplitKeyValTrim(
	splitsBy string,
) (keyTrim, valTrim string)

func (Variant) SplitKeyValue added in v0.2.8

func (it Variant) SplitKeyValue(
	splitter string,
) (left, right string)

func (Variant) SplitKeyValueAsType added in v0.2.8

func (it Variant) SplitKeyValueAsType(
	splitter string,
) (left, right Variant)

func (Variant) SplitKeyValueTrim added in v0.2.8

func (it Variant) SplitKeyValueTrim(
	splitter string,
) (left, right string)

func (Variant) SplitTrimmedNonEmpty added in v0.0.5

func (it Variant) SplitTrimmedNonEmpty(
	splitsBy string,
) []string

func (Variant) SquareWrap added in v0.0.4

func (it Variant) SquareWrap() string

func (Variant) String added in v0.0.4

func (it Variant) String() string

func (Variant) StringValue

func (it Variant) StringValue() string

func (Variant) TitleCurly added in v0.0.4

func (it Variant) TitleCurly(
	title string,
) string

func (Variant) TitleQuotation added in v0.0.4

func (it Variant) TitleQuotation(
	title string,
) string

func (Variant) TitleQuotationReferenceStrings added in v0.0.4

func (it Variant) TitleQuotationReferenceStrings(
	title string,
	csvItems ...string,
) string

func (Variant) TitleQuotationRefs added in v0.0.4

func (it Variant) TitleQuotationRefs(
	title string,
	csvItems ...interface{},
) string

func (Variant) TitleSquare added in v0.0.4

func (it Variant) TitleSquare(
	title string,
) string

func (Variant) ToByteUsingMap added in v0.2.7

func (it Variant) ToByteUsingMap(
	givenMap map[string]byte,
) (val byte, isApplicable bool)

func (Variant) ToByteUsingMapValidationErr added in v0.2.7

func (it Variant) ToByteUsingMapValidationErr(
	givenMap map[string]byte,
) (val byte, err error)

func (Variant) ToErr added in v0.1.3

func (it Variant) ToErr() error

func (Variant) ToIntUsingMapValidationErr added in v0.2.7

func (it Variant) ToIntUsingMapValidationErr(
	givenMap map[string]int,
) (val int, err error)

func (Variant) ToNumberString added in v0.0.4

func (it Variant) ToNumberString() string

func (Variant) ToPtr added in v0.0.4

func (it Variant) ToPtr() *Variant

func (Variant) Trim added in v0.0.4

func (it Variant) Trim() Variant

func (Variant) TypeName added in v0.0.4

func (it Variant) TypeName() string

func (*Variant) UnmarshalJSON added in v0.0.4

func (it *Variant) UnmarshalJSON(data []byte) error

func (Variant) Value

func (it Variant) Value() string

func (Variant) ValueByte added in v0.0.4

func (it Variant) ValueByte() byte

func (Variant) ValueInt added in v0.0.4

func (it Variant) ValueInt() int

func (Variant) ValueInt16 added in v0.0.4

func (it Variant) ValueInt16() int16

func (Variant) ValueInt32 added in v0.0.4

func (it Variant) ValueInt32() int32

func (Variant) ValueInt8 added in v0.0.4

func (it Variant) ValueInt8() int8

func (Variant) ValueString added in v0.0.4

func (it Variant) ValueString() string

func (Variant) ValueUInt16 added in v0.0.4

func (it Variant) ValueUInt16() uint16

func (Variant) Version added in v0.1.3

func (it Variant) Version() *coreversion.Version

Jump to

Keyboard shortcuts

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