isc

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 7

README

isc

isc包是gobase中的基础包,有各种各样的工具

Documentation

Index

Constants

View Source
const (
	MIN_LOW_SURROGATE  = 0xDC00
	MAX_LOW_SURROGATE  = 0xDFFF
	MIN_HIGH_SURROGATE = 0xD800
	MAX_HIGH_SURROGATE = 0xDBFF
)
View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
	TB = 1024 * GB
	PB = 1024 * TB
	EB = 1024 * PB
)

Variables

View Source
var ArrayBlanks = "- "

ArrayBlanks 数组缩进

View Source
View Source
var BannerBinDwenDwen = `` /* 912-byte string literal not displayed */
View Source
var BannerMiku = `` /* 890-byte string literal not displayed */
View Source
var DefaultBanner = `
______   ____     __    __  ____     ____     _____    ____     ____      
/\__  _\ /\  _` + "`" + `\  /\ \  /\ \/\  _` + "`" + `\  /\  _` + "`" + `\  /\  __` + "`" + `\ /\  _` + "`" + `\  /\  _` + "`" + `\    
\/_/\ \/ \ \,\L\_\\ ` + "`" + `\` + "`" + `\\/'/\ \,\L\_\\ \ \/\_\\ \ \/\ \\ \ \L\ \\ \ \L\_\  
   \ \ \  \/_\__ \ ` + "`" + `\ ` + "`" + `\ /'  \/_\__ \ \ \ \/_/_\ \ \ \ \\ \ ,  / \ \  _\L  
    \_\ \__ /\ \L\ \ ` + "`" + `\ \ \    /\ \L\ \\ \ \L\ \\ \ \_\ \\ \ \\ \ \ \ \L\ \
    /\_____\\ ` + "`" + `\____\  \ \_\   \ ` + "`" + `\____\\ \____/ \ \_____\\ \_\ \_\\ \____/
    \/_____/ \/_____/   \/_/    \/_____/ \/___/   \/_____/ \/_/\/ / \/___/ 
`
View Source
var Dot = "."

Dot 点

View Source
var IndentBlanks = "  "

IndentBlanks 缩进空格

View Source
var NewLine = "\n"

NewLine 换行符

View Source
var SignEqual = "="

SignEqual 等号连接符

View Source
var SignSemicolon = ":"

SignSemicolon 分号连接符

View Source
var YamlNewLineDom = "|\n"

YamlNewLineDom yaml的value换行符

Functions

func ArrayToObject

func ArrayToObject(dataArray any, targetPtrObj any) error

func Associate added in v0.2.0

func Associate[T any, K comparable, V any](list []T, transform func(T) Pair[K, V]) map[K]V

Associate Returns a Map containing key-value map provided by transform function applied to elements of the given collection. If any of two map would have the same key the last one gets added to the map. The returned map preserves the entry iteration order of the original collection.

func AssociateBy added in v0.2.0

func AssociateBy[T any, K comparable](list []T, keySelector func(T) K) map[K]T

AssociateBy Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element. If any two elements would have the same key returned by keySelector the last one gets added to the map. The returned map preserves the entry iteration order of the original collection.

func AssociateByAndValue added in v0.2.0

func AssociateByAndValue[T any, V any, K comparable](list []T, keySelector func(T) K, valueTransform func(T) V) map[K]V

AssociateByAndValue Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection. If any two elements would have the same key returned by keySelector the last one gets added to the map. The returned map preserves the entry iteration order of the original collection.

func AssociateByAndValueTo added in v0.2.0

func AssociateByAndValueTo[T, V any, K comparable](list []T, destination *map[K]V, keySelector func(T) K, valueTransform func(T) V) map[K]V

AssociateByAndValueTo Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given collection and value is the element itself. If any two elements would have the same key returned by keySelector the last one gets added to the map

func AssociateByTo added in v0.2.0

func AssociateByTo[T any, K comparable](list []T, destination *map[K]T, keySelector func(T) K) map[K]T

AssociateByTo Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given collection and value is the element itself. If any two elements would have the same key returned by keySelector the last one gets added to the map

func AssociateTo added in v0.2.0

func AssociateTo[T any, K comparable, V any](list []T, destination *map[K]V, transform func(T) Pair[K, V]) map[K]V

AssociateTo Populates and returns the destination map with key-value pairs provided by transform function applied to each element of the given collection. If any of two pairs would have the same key the last one gets added to the map.

func AssociateWith added in v0.2.0

func AssociateWith[T comparable, V any](list []T, valueSelector func(T) V) map[T]V

AssociateWith Returns a Map where keys are elements from the given collection and values are produced by the valueSelector function applied to each element. If any two elements are equal, the last one gets added to the map. The returned map preserves the entry iteration order of the original collection.

func AssociateWithTo added in v0.2.0

func AssociateWithTo[T comparable, V any](list []T, destination *map[T]V, valueSelector func(T) V) map[T]V

AssociateWithTo Populates and returns the destination mutable map with key-value pairs for each element of the given collection, where key is the element itself and value is provided by the valueSelector function applied to that key. If any two elements are equal, the last one overwrites the former value in the map.

func BigCamel added in v1.0.12

func BigCamel(word string) string

BigCamel 小驼峰到大驼峰:首字母变成大写: dataBaseUser -> DateBaseUser

func BigCamelToMiddleLine added in v1.0.12

func BigCamelToMiddleLine(word string) string

BigCamelToMiddleLine 大驼峰到中划线: DataBaseUser -> data-db-user

func BigCamelToPostUnder added in v1.0.12

func BigCamelToPostUnder(word string) string

BigCamelToPostUnder 大驼峰到后缀下划线: DataBaseUser -> data_base_user_

func BigCamelToPrePostUnder added in v1.0.12

func BigCamelToPrePostUnder(word string) string

BigCamelToPrePostUnder 大驼峰到前后缀下划线: DataBaseUser -> _data_base_user_

func BigCamelToPreUnder added in v1.0.12

func BigCamelToPreUnder(word string) string

BigCamelToPreUnder 大驼峰到前后缀下划线: DataBaseUser -> _data_base_user

func BigCamelToSmallCamel added in v1.0.12

func BigCamelToSmallCamel(word string) string

BigCamelToSmallCamel 大驼峰到小驼峰:首字母变成小写:DataBaseUser -> dataBaseUser

func BigCamelToUnderLine added in v1.0.12

func BigCamelToUnderLine(word string) string

BigCamelToUnderLine 大驼峰到下划线:DataBaseUser -> data_base_user

func BigCamelToUpperMiddle added in v1.0.12

func BigCamelToUpperMiddle(word string) string

BigCamelToUpperMiddle 大驼峰到小写中划线:DataBaseUser -> DATA-BASE-USER

func BigCamelToUpperUnder added in v1.0.12

func BigCamelToUpperUnder(word string) string

BigCamelToUpperUnder 大驼峰到大写下划线: DataBaseUser -> DATA_BASE_USER

func Cast

func Cast(fieldKind reflect.Kind, valueStr string) (any, error)

func DataToObject

func DataToObject(data any, targetPtrObj any) error

DataToObject 其他的类型能够按照小写字母转换到对象 其他类型:

  • 基本类型
  • 结构体类型:转换后对象
  • map类型
  • 集合/分片类型
  • 字符串类型:如果是json,则按照json进行转换

func Drop added in v0.0.5

func Drop[T any](list []T, n int) []T

Drop Returns a list containing all elements except first [n] elements.

func DropLast added in v0.0.5

func DropLast[T any](list []T, n int) []T

DropLast Returns a list containing all elements except last n elements

func DropLastWhile added in v0.0.5

func DropLastWhile[T any](list []T, n int, predicate func(T) bool) []T

DropLastWhile Returns a list containing all elements except last elements that satisfy the given predicate.

func DropWhile added in v0.0.5

func DropWhile[T any](list []T, n int, predicate func(T) bool) []T

DropWhile Returns a list containing all elements except first elements that satisfy the given predicate.

func Find added in v0.0.5

func Find[T any](list []T, f func(T) bool) *T

func FindLast added in v0.0.5

func FindLast[T any](list []T, f func(T) bool) *T

func First added in v0.0.5

func First[T any](list []T) T

func FirstOrNull added in v0.0.5

func FirstOrNull[T any](list []T) *T

func FormatSize added in v1.3.0

func FormatSize(fileSize int64) (size string)

func GetPrivateFieldValue added in v1.4.5

func GetPrivateFieldValue(objPtrValue reflect.Value, fieldName string) interface{}

获取对象的属性:一般用于访问私有属性

func GetPropertiesItemLineList

func GetPropertiesItemLineList(content string) []string

func GroupBy

func GroupBy[T any, K comparable](list []T, keySelector func(T) K) (destination map[K][]T)

GroupBy Groups elements of the original collection by the key returned by the given keySelector function applied to each element and returns a map where each group key is associated with a list of corresponding elements. The returned map preserves the entry iteration order of the keys produced from the original collection.

func GroupByTo

func GroupByTo[T any, K comparable](list []T, dest *map[K][]T, keySelector func(T) K) (destination map[K][]T)

GroupByTo Groups elements of the original collection by the key returned by the given keySelector function applied to each element and puts to the dest map each group key associated with a list of corresponding elements. Returns: The dest map‘s val

func GroupByTransform

func GroupByTransform[T any, K comparable, V any](list []T, keySelector func(T) K, trans func(T) V) map[K][]V

GroupByTransform Groups values returned by the trans function applied to each element of the original collection by the key returned by the given keySelector function applied to the element and puts to a map each group key associated with a list of corresponding values.

func GroupByTransformTo

func GroupByTransformTo[T any, K comparable, V any](list []T, dest *map[K][]V, keySelector func(T) K, trans func(T) V) map[K][]V

GroupByTransformTo Groups values returned by the trans function applied to each element of the original collection by the key returned by the given keySelector function applied to the element and puts to the dest map each group key associated with a list of corresponding values. Returns: The dest map's val.

func IfThen added in v1.0.12

func IfThen[T any](condition bool, trueVal T, falseVal T) T

func IndexOf

func IndexOf[T any](list []T, item T) int

IndexOf 判断元素item是否在分片中,示例res := IndexOf[int](list,item),使用时须指明类型

func IndexOfCondition

func IndexOfCondition[T any](list []T, f func(T) bool) int

func Int added in v1.0.0

func Int(AStart, AEnd int) []int

func Int64 added in v1.0.0

func Int64(AStart, AEnd int64) []int64

func Int64Step added in v1.0.0

func Int64Step(AStart, AEnd, AStep int64) []int64

func IntStep added in v1.0.0

func IntStep(AStart, AEnd, AStep int) []int

func IsBaseType

func IsBaseType(fieldType reflect.Type) bool

IsBaseType 是否是常见基本类型

func IsInSlice added in v0.2.0

func IsInSlice[T comparable](list []T, val T) bool

func IsJson

func IsJson(content string) bool

func IsNumber

func IsNumber(fieldKing reflect.Kind) bool

func IsPrivate

func IsPrivate(s string) bool

func IsProperty

func IsProperty(content string) bool

func IsPublic

func IsPublic(s string) bool

func IsYaml

func IsYaml(content string) bool

func JsonToMap

func JsonToMap(contentOfJson string) (map[string]any, error)

func JsonToYaml

func JsonToYaml(contentOfJson string) (string, error)

func KvToProperties

func KvToProperties(key, value string, valueType TypeEnum) (string, error)

func Last added in v0.0.5

func Last[T any](list []T) T

func LastIndexOf

func LastIndexOf[T any](list []T, item T) int

func LastIndexOfCondition

func LastIndexOfCondition[T any](list []T, f func(T) bool) int

func LastOrNull added in v0.0.5

func LastOrNull[T any](list []T) *T

func ListAll

func ListAll[T any](list []T, f func(T) bool) bool

func ListAny

func ListAny[T any](list []T, f func(T) bool) bool

func ListContains

func ListContains[T any](list []T, item T) bool

func ListCount

func ListCount[T any](list []T, f func(T) bool) int

func ListDistinct added in v0.1.0

func ListDistinct[T any](list []T) []T

func ListEquals added in v0.7.0

func ListEquals[T any](leftList []T, rightList []T) bool

ListEquals 比较两个数组是否相同

func ListFilter added in v0.0.5

func ListFilter[T any](list []T, f func(T) bool) []T

ListFilter filter specificated item in a list

func ListFilterIndexed added in v0.0.5

func ListFilterIndexed[T any](list []T, predicate func(int, T) bool) []T

ListFilterIndexed Returns a list containing only elements matching the given predicate. Params: predicate - function that takes the index of an element and the element itself and returns the result of predicate evaluation on the element.

func ListFilterIndexedTo added in v0.0.5

func ListFilterIndexedTo[T any](list []T, dest *[]T, predicate func(int, T) bool) []T

ListFilterIndexedTo Appends all elements matching the given predicate to the given destination. Params: predicate - function that takes the index of an element and the element itself and returns the result of predicate evaluation on the element.

func ListFilterNot added in v0.0.5

func ListFilterNot[T any](list []T, predicate func(T) bool) []T

ListFilterNot Returns a list containing all elements not matching the given predicate.

func ListFilterNotIndexed added in v0.0.5

func ListFilterNotIndexed[T any](list []T, f func(int, T) bool) []T

ListFilterNotIndexed Appends all elements matching the given predicate to the given destination. Params: predicate - function that takes the index of an element and the element itself and returns the result of predicate evaluation on the element.

func ListFilterNotIndexedTo added in v0.0.5

func ListFilterNotIndexedTo[T any](list []T, dest *[]T, predicate func(int, T) bool) []T

ListFilterNotIndexedTo Appends all elements not matching the given predicate to the given destination. Params: predicate - function that takes the index of an element and the element itself and returns the result of predicate evaluation on the element.

func ListFilterNotNull added in v0.0.5

func ListFilterNotNull[T any](list []*T) []*T

ListFilterNotNull Returns a list containing all elements that are not null.

func ListFilterNotTo added in v0.0.5

func ListFilterNotTo[T any](list []T, dest *[]T, predicate func(T) bool) []T

ListFilterNotTo Appends all elements not matching the given predicate to the given destination.

func ListFilterTo added in v0.0.5

func ListFilterTo[T any](list []T, dest *[]T, f func(T) bool) []T

ListFilterTo Appends all elements matching the given predicate to the given dest.

func ListFlatMap added in v0.0.5

func ListFlatMap[T any, R any](list []T, f func(T) []R) []R

func ListFlatMapIndexed added in v0.0.5

func ListFlatMapIndexed[T any, R any](list []T, f func(int, T) []R) []R

func ListFlatMapIndexedTo added in v0.0.5

func ListFlatMapIndexedTo[T any, R any](list []T, dest *[]R, f func(int, T) []R) []R

func ListFlatMapTo added in v0.0.5

func ListFlatMapTo[T any, R any](list []T, dest *[]R, f func(T) []R) []R

func ListFlattern added in v0.0.5

func ListFlattern[T any](list [][]T) []T

func ListJoinToString added in v0.0.5

func ListJoinToString[T any](list []T, f func(T) string) string

func ListJoinToStringFull added in v0.0.5

func ListJoinToStringFull[T any](list []T, sep string, prefix string, postfix string, f func(T) string) string

func ListMap added in v0.0.5

func ListMap[T any, R any](list []T, f func(T) R) []R

func ListMapIndexed added in v0.0.5

func ListMapIndexed[T any, R any](list []T, f func(int, T) R) []R

func ListMapIndexedNotNull added in v0.0.5

func ListMapIndexedNotNull[T any, R any](list []*T, f func(int, T) R) []R

func ListMapIndexedNotNullTo added in v0.0.5

func ListMapIndexedNotNullTo[T any, R any](list []*T, dest *[]R, f func(int, T) R) []R

func ListMapIndexedTo added in v0.0.5

func ListMapIndexedTo[T any, R any](list []T, dest *[]R, f func(int, T) R) []R

func ListMapNotNull added in v0.0.5

func ListMapNotNull[T any, R any](list []*T, f func(T) R) []R

func ListMapNotNullTo added in v0.0.5

func ListMapNotNullTo[T any, R any](list []*T, dest *[]R, f func(T) R) []R

func ListMapTo added in v0.0.5

func ListMapTo[T any, R any](list []T, dest *[]R, f func(T) R) []R

func ListMinus added in v0.2.0

func ListMinus[T any](list []T, n []T) []T

func ListNone

func ListNone[T any](list []T, f func(T) bool) bool

func ListPlus added in v0.2.0

func ListPlus[T any](list []T, n []T) []T

func ListToMap added in v0.0.5

func ListToMap[K comparable, V any](list []Pair[K, V]) map[K]V

func LoadBanner added in v0.8.0

func LoadBanner(filePath string)

func MapAll

func MapAll[K comparable, V any](m map[K]V, f func(K, V) bool) bool

func MapAllKey

func MapAllKey[K comparable, V any](m map[K]V, f func(K) bool) bool

func MapAllValue

func MapAllValue[K comparable, V any](m map[K]V, f func(V) bool) bool

func MapAny

func MapAny[K comparable, V any](m map[K]V, f func(K, V) bool) bool

func MapAnyKey

func MapAnyKey[K comparable, V any](m map[K]V, f func(K) bool) bool

func MapAnyValue

func MapAnyValue[K comparable, V any](m map[K]V, f func(V) bool) bool

func MapContains

func MapContains[K comparable, V any](m map[K]V, k K, v V) bool

func MapContainsKey

func MapContainsKey[K comparable, V any](m map[K]V, k K) bool

func MapContainsValue

func MapContainsValue[K comparable, V any](m map[K]V, v V) bool

func MapCount

func MapCount[K comparable, V any](m map[K]V, f func(K, V) bool) int

func MapCountKey

func MapCountKey[K comparable, V any](m map[K]V, f func(K) bool) int

func MapCountValue

func MapCountValue[K comparable, V any](m map[K]V, f func(V) bool) int

func MapEquals added in v0.7.0

func MapEquals[K comparable, V any](leftMap map[K]V, rightMap map[K]V) bool

MapEquals 比较两个map是否相同

func MapFilter

func MapFilter[K comparable, V any](m map[K]V, f func(K, V) bool) map[K]V

func MapFilterKeys

func MapFilterKeys[K comparable, V any](m map[K]V, f func(K) bool) map[K]V

func MapFilterNot

func MapFilterNot[K comparable, V any](m map[K]V, f func(K, V) bool) map[K]V

func MapFilterNotTo

func MapFilterNotTo[K comparable, V any](m map[K]V, dest *map[K]V, f func(K, V) bool) map[K]V

func MapFilterTo

func MapFilterTo[K comparable, V any](m map[K]V, dest *map[K]V, f func(K, V) bool) map[K]V

func MapFilterValues

func MapFilterValues[K comparable, V any](m map[K]V, f func(V) bool) map[K]V

func MapFlatMap added in v0.0.5

func MapFlatMap[K comparable, V any, R any](m map[K]V, f func(K, V) []R) []R

func MapFlatMapTo added in v0.0.5

func MapFlatMapTo[K comparable, V any, R any](m map[K]V, dest *[]R, f func(K, V) []R) []R

func MapJoinToString added in v0.0.5

func MapJoinToString[K comparable, V any](m map[K]V, f func(K, V) string) string

func MapJoinToStringFull added in v0.0.5

func MapJoinToStringFull[K comparable, V any](m map[K]V, sep string, prefix string, postfix string, f func(K, V) string) string

func MapMap added in v0.0.5

func MapMap[K comparable, V any, R any](m map[K]V, f func(K, V) R) []R

func MapMapNotNull added in v0.0.5

func MapMapNotNull[K comparable, V any, R any](m map[K]*V, f func(K, V) R) []R

func MapMapNotNullTo added in v0.0.5

func MapMapNotNullTo[K comparable, V any, R any](m map[K]*V, dest *[]R, f func(K, V) R) []R

func MapMapTo added in v0.0.5

func MapMapTo[K comparable, V any, R any](m map[K]V, dest *[]R, f func(K, V) R) []R

func MapMinus added in v0.2.0

func MapMinus[K comparable, V any](m map[K]V, n map[K]V) map[K]V

func MapNone

func MapNone[K comparable, V any](m map[K]V, f func(K, V) bool) bool

func MapNoneKey

func MapNoneKey[K comparable, V any](m map[K]V, f func(K) bool) bool

func MapNoneValue

func MapNoneValue[K comparable, V any](m map[K]V, f func(V) bool) bool

func MapPlus added in v0.2.0

func MapPlus[K comparable, V any](m map[K]V, n map[K]V) map[K]V

func MapToObject

func MapToObject(dataMap any, targetPtrObj any) error

func MapToProperties

func MapToProperties(dataMap map[string]any) (string, error)

MapToProperties 进行深层嵌套的map数据处理

func MiddleLine added in v1.0.12

func MiddleLine(word string) string

MiddleLine 小驼峰到中划线:dataBaseUser -> data-db-user

func MiddleLineToBigCamel added in v1.0.12

func MiddleLineToBigCamel(word string) string

MiddleLineToBigCamel 中划线到大驼峰:data-db-user -> DataBaseUser

func MiddleLineToSmallCamel added in v1.0.12

func MiddleLineToSmallCamel(word string) string

MiddleLineToSmallCamel 中划线到小驼峰:data-base-user -> dataBaseUser

func ObjectToData

func ObjectToData(object any) any

ObjectToData 字段转化,其中对应字段为小写,map的话为小写

func ObjectToJson

func ObjectToJson(object any) string

ObjectToJson 对象转化为json,其中map对应的key大小写均可

func ObjectToYaml

func ObjectToYaml(value any) (string, error)

func ParseByteSize added in v1.5.0

func ParseByteSize(byteStr string) (size int64)

func Partition added in v0.2.0

func Partition[T any](list []T, partition int) [][]T

func PartitionWithCal added in v0.2.0

func PartitionWithCal[T any](list []T, f func(int) int) [][]T

PartitionWithCal 计算partition数 f: 入参为数组长度,返回partition数

func PostUnder added in v1.0.12

func PostUnder(word string) string

PostUnder 小驼峰到后下划线:dataBaseUser -> data_base_user_

func PreFixUnderLine added in v1.0.12

func PreFixUnderLine(word, preFix string) string

PreFixUnderLine 小驼峰到添加前缀字符下划线:dataBaseUser -> pre_data_base_user

func PreFixUnderToSmallCamel added in v1.0.12

func PreFixUnderToSmallCamel(word, preFix string) string

PreFixUnderToSmallCamel 前缀字符下划线去掉到小驼峰:pre_data_base_user -> dataBaseUser

func PrePostUnder added in v1.0.12

func PrePostUnder(word string) string

PrePostUnder 小驼峰到前后缀下划线:dataBaseUser -> _data_base_user_

func PreUnder added in v1.0.12

func PreUnder(word string) string

PreUnder 小驼峰到前下划线:dataBaseUser -> _data_base_user

func PrintBanner added in v0.8.0

func PrintBanner()

func PropertiesEntityToYaml

func PropertiesEntityToYaml(properties Properties) (string, error)

func PropertiesToMap

func PropertiesToMap(contentOfProperties string) (map[string]any, error)

func PropertiesToYaml

func PropertiesToYaml(contentOfProperties string) (string, error)

func ReaderToObject

func ReaderToObject(reader io.Reader, targetPtrObj any) error

func Reduce added in v0.0.5

func Reduce[S any, T any](list []T, init func(T) S, f func(S, T) S) S

func ReduceIndexed added in v0.0.5

func ReduceIndexed[S any, T any](list []T, init func(int, T) S, f func(int, S, T) S) S

func SetFieldPrivateValue added in v1.4.5

func SetFieldPrivateValue(objPtrValue reflect.Value, fieldName string, fieldNewValue reflect.Value)

给对象的属性设置值:一般用于设置私有属性

func Slice added in v0.0.5

func Slice[T any](list []T, r IntRange) []T

Slice 分片截取,参数详情见 IntRange ,返回新分片

func SliceContains added in v0.2.0

func SliceContains[T any, K comparable](list []T, predicate func(T) K, key K) bool

SliceContains Returns true if element is found in the collection. predicate keySelector if you want to check item in list, please use ListContains

func SliceDistinct added in v0.2.0

func SliceDistinct[T any](list []T) []T

func SliceDistinctTo added in v0.2.0

func SliceDistinctTo[T any, V comparable](list []T, valueTransform func(T) V) []T

SliceDistinctTo Returns a list containing only distinct elements from the given collection. Among equal elements of the given collection, only the last one will be present in the resulting list. The elements in the resulting list are not in the same order as they were in the source collection.

func SliceTo added in v0.2.0

func SliceTo[T any, K comparable](list []T, valueTransform func(T) K) map[K]T

func SliceToMap added in v0.2.0

func SliceToMap[T comparable](list []T) map[T]T

func StrToObject

func StrToObject(contentOfJson string, targetPtrObj any) error

func StreamDrain added in v0.6.0

func StreamDrain[T any](ch <-chan T)

StreamDrain drains the given channel.

func SubList added in v0.0.5

func SubList[T any](list []T, fromIndex int, toIndex int) []T

SubList 分片截取

func Take added in v0.0.5

func Take[T any](list []T, n int) []T

Take Returns a list containing first n elements.

func TakeLast added in v0.0.5

func TakeLast[T any](list []T, n int) []T

TakeLast Returns a list containing last n elements.

func TakeLastWhile added in v0.0.5

func TakeLastWhile[T any](list []T, n int, predicate func(T) bool) []T

TakeLastWhile Returns a list containing first elements satisfying the given predicate.

func TakeWhile added in v0.0.5

func TakeWhile[T any](list []T, n int, predicate func(T) bool) []T

TakeWhile Returns a list containing first elements satisfying the given predicate.

func ToBool

func ToBool(value any) bool

func ToComplex128

func ToComplex128(value any) complex128

func ToComplex64

func ToComplex64(value any) complex64

func ToFloat32

func ToFloat32(value any) float32

func ToFloat64

func ToFloat64(value any) float64

func ToInt

func ToInt(value any) int

func ToInt16

func ToInt16(value any) int16

func ToInt32

func ToInt32(value any) int32

func ToInt64

func ToInt64(value any) int64

func ToInt8

func ToInt8(value any) int8

func ToJsonString

func ToJsonString(value any) string

func ToLowerFirstPrefix

func ToLowerFirstPrefix(dataStr string) string

ToLowerFirstPrefix 首字母小写

func ToMap

func ToMap(data any) map[string]any

func ToString

func ToString(value any) string

func ToUInt

func ToUInt(value any) uint

func ToUInt16

func ToUInt16(value any) uint16

func ToUInt32

func ToUInt32(value any) uint32

func ToUInt64

func ToUInt64(value any) uint64

func ToUInt8

func ToUInt8(value any) uint8

func ToUpperFirstPrefix

func ToUpperFirstPrefix(dataStr string) string

ToUpperFirstPrefix 首字母大写

func ToUpperWord added in v1.0.12

func ToUpperWord(regex, word string) string

ToUpperWord 匹配的单词变为大写 regex: 正则表达式,主要用于匹配某些字符变为大写 word: 待匹配字段

func ToValue

func ToValue(value any, valueKind reflect.Kind) (any, error)

func UnderLine added in v1.0.12

func UnderLine(word string) string

UnderLine 小驼峰到下划线:非边缘单词开头大写变前下划线和后面大写:dataBaseUser -> data_base_user

func UnderLineToBigCamel added in v1.0.12

func UnderLineToBigCamel(word string) string

UnderLineToBigCamel 下划线到大驼峰:下划线后面小写变大写,下划线去掉 data_base_user -> DataBaseUser _data_base_user -> DataBaseUser _data_base_user_ -> DataBaseUser data_base_user_ -> DataBaseUser

func UnderLineToSmallCamel added in v1.0.12

func UnderLineToSmallCamel(word string) string

UnderLineToSmallCamel 下划线到小驼峰:下划线后面小写变大写,下划线去掉 data_base_user -> dataBaseUser _data_base_user -> dataBaseUser _data_base_user_ -> dataBaseUser data_base_user_ -> dataBaseUser

func UpperMiddleToBigCamel added in v1.0.12

func UpperMiddleToBigCamel(word string) string

大写中划线到大驼峰:DATA-BASE-USER -> DataBaseUser

func UpperUnder added in v1.0.12

func UpperUnder(word string) string

UpperUnder 小驼峰到大写下划线:dataBaseUser -> DATA_BASE_USER

func UpperUnderMiddle added in v1.0.12

func UpperUnderMiddle(word string) string

UpperUnderMiddle 小驼峰到大写中划线:dataBaseUser -> DATA-BASE-USER

func UpperUnderMiddleToSmallCamel added in v1.0.12

func UpperUnderMiddleToSmallCamel(word string) string

UpperUnderMiddleToSmallCamel 大写中划线到大驼峰:DATA-BASE-USER -> dataBaseUser

func UpperUnderToBigCamel added in v1.0.12

func UpperUnderToBigCamel(word string) string

UpperUnderToBigCamel 大写下划线到大驼峰:DATA_BASE_USER -> DataBaseUser

func UpperUnderToSmallCamel added in v1.0.12

func UpperUnderToSmallCamel(word string) string

UpperUnderToSmallCamel 大写下划线到小驼峰:DATA_BASE_USER -> dataBaseUser

func YamlCheck

func YamlCheck(content string) error

func YamlToJson

func YamlToJson(contentOfYaml string) (string, error)

func YamlToList

func YamlToList(contentOfYaml string) ([]any, error)

func YamlToMap

func YamlToMap(contentOfYaml string) (map[string]any, error)

func YamlToProperties

func YamlToProperties(contentOfYaml string) (string, error)

func YamlToPropertiesWithKey

func YamlToPropertiesWithKey(key string, contentOfYaml string) (string, error)

Types

type ChangeError

type ChangeError struct {
	ErrMsg string
}

func (*ChangeError) Error

func (error *ChangeError) Error() string

type ConvertError

type ConvertError struct {
	// contains filtered or unexported fields
}

func (*ConvertError) Error

func (convertError *ConvertError) Error() string

type ISCChar added in v1.0.5

type ISCChar rune

func (ISCChar) Code added in v1.0.6

func (i ISCChar) Code() int

func (ISCChar) DownStepTo added in v1.0.6

func (i ISCChar) DownStepTo(to rune, step int64) ISCList[rune]

func (ISCChar) DownTo added in v1.0.6

func (i ISCChar) DownTo(to rune) ISCList[rune]

func (ISCChar) IsDigit added in v1.0.6

func (i ISCChar) IsDigit() bool

func (ISCChar) IsHighSurrogate added in v1.0.6

func (i ISCChar) IsHighSurrogate() bool

func (ISCChar) IsISOControl added in v1.0.6

func (i ISCChar) IsISOControl() bool

func (ISCChar) IsLetter added in v1.0.6

func (i ISCChar) IsLetter() bool

func (ISCChar) IsLetterOrDigit added in v1.0.6

func (i ISCChar) IsLetterOrDigit() bool

func (ISCChar) IsLowSurrogate added in v1.0.6

func (i ISCChar) IsLowSurrogate() bool

func (ISCChar) IsLower added in v1.0.6

func (i ISCChar) IsLower() bool

func (ISCChar) IsSymbol added in v1.0.6

func (i ISCChar) IsSymbol() bool

func (ISCChar) IsTitle added in v1.0.6

func (i ISCChar) IsTitle() bool

func (ISCChar) IsUpper added in v1.0.6

func (i ISCChar) IsUpper() bool

func (ISCChar) IsWhitespace added in v1.0.6

func (i ISCChar) IsWhitespace() bool

func (ISCChar) RangeStepTo added in v1.0.6

func (i ISCChar) RangeStepTo(to rune, step int64) ISCList[rune]

func (ISCChar) RangeTo added in v1.0.6

func (i ISCChar) RangeTo(to rune) ISCList[rune]

func (ISCChar) ToLower added in v1.0.6

func (i ISCChar) ToLower() ISCChar

func (ISCChar) ToString added in v1.0.5

func (i ISCChar) ToString() ISCString

func (ISCChar) ToTitle added in v1.0.6

func (i ISCChar) ToTitle() ISCChar

func (ISCChar) ToUpper added in v1.0.6

func (i ISCChar) ToUpper() ISCChar

type ISCFloat added in v1.0.5

type ISCFloat float32

func (ISCFloat) ToString added in v1.0.5

func (i ISCFloat) ToString() ISCString

type ISCFloat64 added in v1.0.5

type ISCFloat64 float64

func (ISCFloat64) ToString added in v1.0.5

func (i ISCFloat64) ToString() ISCString

type ISCInt added in v1.0.5

type ISCInt int

func (ISCInt) DownStepTo added in v1.0.5

func (i ISCInt) DownStepTo(to int, step int) ISCList[int]

func (ISCInt) DownTo added in v1.0.5

func (i ISCInt) DownTo(to int) ISCList[int]

func (ISCInt) RangeStepTo added in v1.0.5

func (i ISCInt) RangeStepTo(to int, step int) ISCList[int]

func (ISCInt) RangeTo added in v1.0.5

func (i ISCInt) RangeTo(to int) ISCList[int]

func (ISCInt) RotateLeft added in v1.0.5

func (i ISCInt) RotateLeft(bitCount int) ISCInt

func (ISCInt) RotateRight added in v1.0.5

func (i ISCInt) RotateRight(bitCount int) ISCInt

func (ISCInt) ToBinary added in v1.0.5

func (i ISCInt) ToBinary() string

func (ISCInt) ToHex added in v1.0.5

func (i ISCInt) ToHex() string

func (ISCInt) ToOct added in v1.0.5

func (i ISCInt) ToOct() string

func (ISCInt) ToString added in v1.0.5

func (i ISCInt) ToString() ISCString

type ISCInt16 added in v1.0.5

type ISCInt16 int16

func (ISCInt16) DownStepTo added in v1.0.5

func (i ISCInt16) DownStepTo(to int16, step int16) ISCList[int16]

func (ISCInt16) DownTo added in v1.0.5

func (i ISCInt16) DownTo(to int16) ISCList[int16]

func (ISCInt16) RangeStepTo added in v1.0.5

func (i ISCInt16) RangeStepTo(to int16, step int16) ISCList[int16]

func (ISCInt16) RangeTo added in v1.0.5

func (i ISCInt16) RangeTo(to int16) ISCList[int16]

func (ISCInt16) RotateLeft added in v1.0.5

func (i ISCInt16) RotateLeft(bitCount int16) ISCInt16

func (ISCInt16) RotateRight added in v1.0.5

func (i ISCInt16) RotateRight(bitCount int16) ISCInt16

func (ISCInt16) ToBinary added in v1.0.5

func (i ISCInt16) ToBinary() string

func (ISCInt16) ToHex added in v1.0.5

func (i ISCInt16) ToHex() string

func (ISCInt16) ToOct added in v1.0.5

func (i ISCInt16) ToOct() string

func (ISCInt16) ToString added in v1.0.5

func (i ISCInt16) ToString() ISCString

type ISCInt32 added in v1.0.5

type ISCInt32 int32

func (ISCInt32) DownStepTo added in v1.0.5

func (i ISCInt32) DownStepTo(to int32, step int32) ISCList[int32]

func (ISCInt32) DownTo added in v1.0.5

func (i ISCInt32) DownTo(to int32) ISCList[int32]

func (ISCInt32) RangeStepTo added in v1.0.5

func (i ISCInt32) RangeStepTo(to int32, step int32) ISCList[int32]

func (ISCInt32) RangeTo added in v1.0.5

func (i ISCInt32) RangeTo(to int32) ISCList[int32]

func (ISCInt32) RotateLeft added in v1.0.5

func (i ISCInt32) RotateLeft(bitCount int32) ISCInt32

func (ISCInt32) RotateRight added in v1.0.5

func (i ISCInt32) RotateRight(bitCount int32) ISCInt32

func (ISCInt32) ToBinary added in v1.0.5

func (i ISCInt32) ToBinary() string

func (ISCInt32) ToHex added in v1.0.5

func (i ISCInt32) ToHex() string

func (ISCInt32) ToOct added in v1.0.5

func (i ISCInt32) ToOct() string

func (ISCInt32) ToString added in v1.0.5

func (i ISCInt32) ToString() ISCString

type ISCInt64 added in v1.0.5

type ISCInt64 int64

func (ISCInt64) DownStepTo added in v1.0.5

func (i ISCInt64) DownStepTo(to int64, step int64) ISCList[int64]

func (ISCInt64) DownTo added in v1.0.5

func (i ISCInt64) DownTo(to int64) ISCList[int64]

func (ISCInt64) RangeStepTo added in v1.0.5

func (i ISCInt64) RangeStepTo(to int64, step int64) ISCList[int64]

func (ISCInt64) RangeTo added in v1.0.5

func (i ISCInt64) RangeTo(to int64) ISCList[int64]

func (ISCInt64) RotateLeft added in v1.0.5

func (i ISCInt64) RotateLeft(bitCount int64) ISCInt64

func (ISCInt64) RotateRight added in v1.0.5

func (i ISCInt64) RotateRight(bitCount int64) ISCInt64

func (ISCInt64) ToBinary added in v1.0.5

func (i ISCInt64) ToBinary() string

func (ISCInt64) ToHex added in v1.0.5

func (i ISCInt64) ToHex() string

func (ISCInt64) ToOct added in v1.0.5

func (i ISCInt64) ToOct() string

func (ISCInt64) ToString added in v1.0.5

func (i ISCInt64) ToString() ISCString

type ISCInt8 added in v1.0.5

type ISCInt8 int8

func (ISCInt8) DownStepTo added in v1.0.5

func (i ISCInt8) DownStepTo(to int8, step int8) ISCList[int8]

func (ISCInt8) DownTo added in v1.0.5

func (i ISCInt8) DownTo(to int8) ISCList[int8]

func (ISCInt8) RangeStepTo added in v1.0.5

func (i ISCInt8) RangeStepTo(to int8, step int8) ISCList[int8]

func (ISCInt8) RangeTo added in v1.0.5

func (i ISCInt8) RangeTo(to int8) ISCList[int8]

func (ISCInt8) RotateLeft added in v1.0.5

func (i ISCInt8) RotateLeft(bitCount int8) ISCInt8

func (ISCInt8) RotateRight added in v1.0.5

func (i ISCInt8) RotateRight(bitCount int8) ISCInt8

func (ISCInt8) ToBinary added in v1.0.5

func (i ISCInt8) ToBinary() string

func (ISCInt8) ToHex added in v1.0.5

func (i ISCInt8) ToHex() string

func (ISCInt8) ToOct added in v1.0.5

func (i ISCInt8) ToOct() string

func (ISCInt8) ToString added in v1.0.5

func (i ISCInt8) ToString() ISCString

type ISCList

type ISCList[T any] []T

func NewList

func NewList[T any]() ISCList[T]

func NewListWithItems added in v0.0.5

func NewListWithItems[T any](items ...T) ISCList[T]

func NewListWithList added in v0.1.0

func NewListWithList[T any](list []T) ISCList[T]

func (*ISCList[T]) Add added in v0.1.0

func (l *ISCList[T]) Add(item T) int

func (*ISCList[T]) AddAll added in v0.1.0

func (l *ISCList[T]) AddAll(item ...T)

func (ISCList[T]) All added in v0.0.5

func (l ISCList[T]) All(f func(T) bool) bool

func (ISCList[T]) Any added in v0.0.5

func (l ISCList[T]) Any(f func(T) bool) bool

func (*ISCList[T]) Clear added in v0.1.0

func (l *ISCList[T]) Clear()

func (ISCList[T]) Contains added in v0.0.5

func (l ISCList[T]) Contains(item T) bool

func (ISCList[T]) Count added in v0.0.5

func (l ISCList[T]) Count(f func(T) bool) int

func (*ISCList[T]) Delete added in v0.1.0

func (l *ISCList[T]) Delete(index int) T

func (ISCList[T]) Distinct added in v0.1.0

func (l ISCList[T]) Distinct() ISCList[T]

func (ISCList[T]) Drop added in v0.0.5

func (l ISCList[T]) Drop(n int) ISCList[T]

func (ISCList[T]) DropLast added in v0.0.5

func (l ISCList[T]) DropLast(n int) ISCList[T]

func (ISCList[T]) DropLastWhile added in v0.0.5

func (l ISCList[T]) DropLastWhile(n int, f func(T) bool) ISCList[T]

func (ISCList[T]) DropWhile added in v0.0.5

func (l ISCList[T]) DropWhile(n int, f func(T) bool) ISCList[T]

func (ISCList[T]) Equals added in v0.7.0

func (l ISCList[T]) Equals(n ISCList[T]) bool

func (ISCList[T]) Filter added in v0.0.5

func (l ISCList[T]) Filter(f func(T) bool) ISCList[T]

func (ISCList[T]) FilterIndexed added in v0.0.5

func (l ISCList[T]) FilterIndexed(f func(int, T) bool) ISCList[T]

func (ISCList[T]) FilterIndexedTo added in v0.0.5

func (l ISCList[T]) FilterIndexedTo(dest *[]T, f func(int, T) bool) ISCList[T]

func (ISCList[T]) FilterNot added in v0.0.5

func (l ISCList[T]) FilterNot(f func(T) bool) ISCList[T]

func (ISCList[T]) FilterNotIndexed added in v0.0.5

func (l ISCList[T]) FilterNotIndexed(f func(int, T) bool) ISCList[T]

func (ISCList[T]) FilterNotIndexedTo added in v0.0.5

func (l ISCList[T]) FilterNotIndexedTo(dest *[]T, f func(int, T) bool) ISCList[T]

func (ISCList[T]) FilterNotTo added in v0.0.5

func (l ISCList[T]) FilterNotTo(dest *[]T, f func(T) bool) ISCList[T]

func (ISCList[T]) FilterTo added in v0.0.5

func (l ISCList[T]) FilterTo(dest *[]T, f func(T) bool) ISCList[T]

func (ISCList[T]) Find added in v0.0.5

func (l ISCList[T]) Find(f func(T) bool) *T

func (ISCList[T]) FindLast added in v0.0.5

func (l ISCList[T]) FindLast(f func(T) bool) *T

func (ISCList[T]) First added in v0.0.5

func (l ISCList[T]) First() T

func (ISCList[T]) FirstOrNull added in v0.0.5

func (l ISCList[T]) FirstOrNull() *T

func (ISCList[T]) ForEach added in v0.1.0

func (l ISCList[T]) ForEach(f func(T))

func (ISCList[T]) ForEachIndexed added in v0.1.0

func (l ISCList[T]) ForEachIndexed(f func(int, T))

func (ISCList[T]) IndexOf added in v0.0.5

func (l ISCList[T]) IndexOf(item T) int

func (ISCList[T]) IndexOfCondition added in v0.0.5

func (l ISCList[T]) IndexOfCondition(f func(T) bool) int

func (*ISCList[T]) Insert added in v0.1.0

func (l *ISCList[T]) Insert(index int, item T) int

func (ISCList[T]) IsEmpty added in v0.0.5

func (l ISCList[T]) IsEmpty() bool

func (ISCList[T]) JoinToString added in v0.0.5

func (l ISCList[T]) JoinToString(f func(T) string) string

func (ISCList[T]) JoinToStringFull added in v0.0.5

func (l ISCList[T]) JoinToStringFull(sep string, prefix string, postfix string, f func(T) string) string

func (ISCList[T]) Last added in v0.0.5

func (l ISCList[T]) Last() T

func (ISCList[T]) LastIndexOf added in v0.0.5

func (l ISCList[T]) LastIndexOf(item T) int

func (ISCList[T]) LastIndexOfCondition added in v0.0.5

func (l ISCList[T]) LastIndexOfCondition(f func(T) bool) int

func (ISCList[T]) LastOrNull added in v0.0.5

func (l ISCList[T]) LastOrNull() *T

func (ISCList[T]) Minus added in v0.2.0

func (l ISCList[T]) Minus(n []T) ISCList[T]

func (ISCList[T]) None added in v0.0.5

func (l ISCList[T]) None(f func(T) bool) bool

func (ISCList[T]) Partition added in v0.2.0

func (l ISCList[T]) Partition(partition int) [][]T

func (ISCList[T]) PartitionWithCal added in v0.2.0

func (l ISCList[T]) PartitionWithCal(f func(int) int) [][]T

func (ISCList[T]) Plus added in v0.2.0

func (l ISCList[T]) Plus(n []T) ISCList[T]

func (ISCList[T]) Size added in v0.6.0

func (l ISCList[T]) Size() int

func (ISCList[T]) Slice added in v0.0.5

func (l ISCList[T]) Slice(r IntRange) ISCList[T]

func (ISCList[T]) SubList added in v0.0.5

func (l ISCList[T]) SubList(fromIndex int, toIndex int) ISCList[T]

func (ISCList[T]) Take added in v0.0.5

func (l ISCList[T]) Take(n int) ISCList[T]

func (ISCList[T]) TakeLast added in v0.0.5

func (l ISCList[T]) TakeLast(n int) ISCList[T]

func (ISCList[T]) TakeLastWhile added in v0.0.5

func (l ISCList[T]) TakeLastWhile(n int, f func(T) bool) ISCList[T]

func (ISCList[T]) TakeWhile added in v0.0.5

func (l ISCList[T]) TakeWhile(n int, f func(T) bool) ISCList[T]

type ISCListToMap added in v0.0.5

type ISCListToMap[T any, R any] struct {
	ISCList[T]
}

func ListToMapFrom added in v0.0.5

func ListToMapFrom[T any, R any](list ISCList[T]) ISCListToMap[T, R]

func (ISCListToMap[T, R]) FlatMap added in v0.0.5

func (l ISCListToMap[T, R]) FlatMap(f func(T) []R) ISCList[R]

func (ISCListToMap[T, R]) FlatMapIndexed added in v0.0.5

func (l ISCListToMap[T, R]) FlatMapIndexed(f func(int, T) []R) ISCList[R]

func (ISCListToMap[T, R]) FlatMapIndexedTo added in v0.0.5

func (l ISCListToMap[T, R]) FlatMapIndexedTo(dest *[]R, f func(int, T) []R) ISCList[R]

func (ISCListToMap[T, R]) FlatMapTo added in v0.0.5

func (l ISCListToMap[T, R]) FlatMapTo(dest *[]R, f func(T) []R) ISCList[R]

func (ISCListToMap[T, R]) Map added in v0.0.5

func (l ISCListToMap[T, R]) Map(f func(T) R) ISCList[R]

func (ISCListToMap[T, R]) MapIndexed added in v0.0.5

func (l ISCListToMap[T, R]) MapIndexed(f func(int, T) R) ISCList[R]

func (ISCListToMap[T, R]) MapIndexedTo added in v0.0.5

func (l ISCListToMap[T, R]) MapIndexedTo(dest *[]R, f func(int, T) R) ISCList[R]

func (ISCListToMap[T, R]) MapTo added in v0.0.5

func (l ISCListToMap[T, R]) MapTo(dest *[]R, f func(T) R) ISCList[R]

func (ISCListToMap[T, R]) Reduce added in v0.0.5

func (l ISCListToMap[T, R]) Reduce(init func(T) R, f func(R, T) R) R

func (ISCListToMap[T, R]) ReduceIndexed added in v0.0.5

func (l ISCListToMap[T, R]) ReduceIndexed(init func(int, T) R, f func(int, R, T) R) R

type ISCListToPair added in v0.0.5

type ISCListToPair[K comparable, V comparable] struct {
	ISCList[Pair[K, V]]
}

func ListToPairFrom added in v0.0.5

func ListToPairFrom[K comparable, V comparable](list ISCList[Pair[K, V]]) ISCListToPair[K, V]

func ListToPairWithPairs added in v0.0.5

func ListToPairWithPairs[K comparable, V comparable](list ...Pair[K, V]) ISCListToPair[K, V]

func (ISCListToPair[K, V]) ToMap added in v0.0.5

func (l ISCListToPair[K, V]) ToMap() ISCMap[K, V]

type ISCListToSlice added in v0.7.3

type ISCListToSlice[T any, R comparable] struct {
	ISCList[T]
}

func ListToSliceFrom added in v0.7.3

func ListToSliceFrom[T any, R comparable](list ISCList[T]) ISCListToSlice[T, R]

func (ISCListToSlice[T, R]) SliceContains added in v0.7.3

func (l ISCListToSlice[T, R]) SliceContains(predicate func(T) R, key R) bool

func (ISCListToSlice[T, R]) SliceTo added in v0.7.3

func (l ISCListToSlice[T, R]) SliceTo(valueTransform func(T) R) ISCMap[R, T]

type ISCListToTriple added in v0.2.0

type ISCListToTriple[T comparable, K comparable, V any] struct {
	ISCList[T]
}

func ListToTripleFrom added in v0.7.3

func ListToTripleFrom[T comparable, K comparable, V any](list ISCList[T]) ISCListToTriple[T, K, V]

func (ISCListToTriple[T, K, V]) Associate added in v0.2.0

func (l ISCListToTriple[T, K, V]) Associate(transform func(T) Pair[K, V]) ISCMap[K, V]

func (ISCListToTriple[T, K, V]) AssociateBy added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateBy(keySelector func(T) K) ISCMap[K, T]

func (ISCListToTriple[T, K, V]) AssociateByAndValue added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateByAndValue(keySelector func(T) K, valueTransform func(T) V) ISCMap[K, V]

func (ISCListToTriple[T, K, V]) AssociateByAndValueTo added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateByAndValueTo(destination *map[K]V, keySelector func(T) K, valueTransform func(T) V) ISCMap[K, V]

func (ISCListToTriple[T, K, V]) AssociateByTo added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateByTo(destination *map[K]T, keySelector func(T) K) ISCMap[K, T]

func (ISCListToTriple[T, K, V]) AssociateTo added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateTo(destination *map[K]V, transform func(T) Pair[K, V]) ISCMap[K, V]

func (ISCListToTriple[T, K, V]) AssociateWith added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateWith(valueSelector func(T) V) ISCMap[T, V]

func (ISCListToTriple[T, K, V]) AssociateWithTo added in v0.2.0

func (l ISCListToTriple[T, K, V]) AssociateWithTo(destination *map[T]V, valueSelector func(T) V) ISCMap[T, V]

func (ISCListToTriple[T, K, V]) GroupBy added in v0.2.0

func (l ISCListToTriple[T, K, V]) GroupBy(f func(T) K) map[K][]T

func (ISCListToTriple[T, K, V]) GroupByTo added in v0.2.0

func (l ISCListToTriple[T, K, V]) GroupByTo(dest *map[K][]T, f func(T) K) map[K][]T

func (ISCListToTriple[T, K, V]) GroupByTransform added in v0.2.0

func (l ISCListToTriple[T, K, V]) GroupByTransform(f func(T) K, trans func(T) V) map[K][]V

func (ISCListToTriple[T, K, V]) GroupByTransformTo added in v0.2.0

func (l ISCListToTriple[T, K, V]) GroupByTransformTo(dest *map[K][]V, f func(T) K, trans func(T) V) map[K][]V

type ISCMap

type ISCMap[K comparable, V any] map[K]V

func NewMap added in v0.0.5

func NewMap[K comparable, V any]() ISCMap[K, V]

func NewMapWithMap added in v0.1.0

func NewMapWithMap[K comparable, V any](ma map[K]V) ISCMap[K, V]

func NewMapWithPairs added in v0.0.5

func NewMapWithPairs[K comparable, V any](pairs ...Pair[K, V]) ISCMap[K, V]

func (ISCMap[K, V]) All added in v0.0.5

func (m ISCMap[K, V]) All(f func(K, V) bool) bool

func (ISCMap[K, V]) AllKey added in v0.0.5

func (m ISCMap[K, V]) AllKey(f func(K) bool) bool

func (ISCMap[K, V]) AllValue added in v0.0.5

func (m ISCMap[K, V]) AllValue(f func(V) bool) bool

func (ISCMap[K, V]) Any added in v0.0.5

func (m ISCMap[K, V]) Any(f func(K, V) bool) bool

func (ISCMap[K, V]) AnyKey added in v0.0.5

func (m ISCMap[K, V]) AnyKey(f func(K) bool) bool

func (ISCMap[K, V]) AnyValue added in v0.0.5

func (m ISCMap[K, V]) AnyValue(f func(V) bool) bool

func (*ISCMap[K, V]) Clear added in v0.1.0

func (m *ISCMap[K, V]) Clear()

func (ISCMap[K, V]) Contains added in v0.0.5

func (m ISCMap[K, V]) Contains(k K, v V) bool

func (ISCMap[K, V]) ContainsKey added in v0.0.5

func (m ISCMap[K, V]) ContainsKey(k K) bool

func (ISCMap[K, V]) ContainsValue added in v0.0.5

func (m ISCMap[K, V]) ContainsValue(v V) bool

func (ISCMap[K, V]) Count added in v0.0.5

func (m ISCMap[K, V]) Count(f func(K, V) bool) int

func (ISCMap[K, V]) CountKey added in v0.0.5

func (m ISCMap[K, V]) CountKey(f func(K) bool) int

func (ISCMap[K, V]) CountValue added in v0.0.5

func (m ISCMap[K, V]) CountValue(f func(V) bool) int

func (ISCMap[K, V]) Delete added in v0.1.0

func (m ISCMap[K, V]) Delete(k K)

func (ISCMap[K, V]) Equals added in v0.7.0

func (m ISCMap[K, V]) Equals(n map[K]V) bool

func (ISCMap[K, V]) Filter added in v0.0.5

func (m ISCMap[K, V]) Filter(f func(K, V) bool) ISCMap[K, V]

func (ISCMap[K, V]) FilterKeys added in v0.0.5

func (m ISCMap[K, V]) FilterKeys(f func(K) bool) ISCMap[K, V]

func (ISCMap[K, V]) FilterNot added in v0.0.5

func (m ISCMap[K, V]) FilterNot(f func(K, V) bool) ISCMap[K, V]

func (ISCMap[K, V]) FilterNotTo added in v0.0.5

func (m ISCMap[K, V]) FilterNotTo(dest *map[K]V, f func(K, V) bool) ISCMap[K, V]

func (ISCMap[K, V]) FilterTo added in v0.0.5

func (m ISCMap[K, V]) FilterTo(dest *map[K]V, f func(K, V) bool) ISCMap[K, V]

func (ISCMap[K, V]) FilterValues added in v0.0.5

func (m ISCMap[K, V]) FilterValues(f func(V) bool) ISCMap[K, V]

func (ISCMap[K, V]) ForEach added in v0.1.0

func (m ISCMap[K, V]) ForEach(f func(K, V))

func (ISCMap[K, V]) Get added in v0.1.0

func (m ISCMap[K, V]) Get(k K) V

func (ISCMap[K, V]) GetOrDef added in v0.1.0

func (m ISCMap[K, V]) GetOrDef(k K, def V) V

func (ISCMap[K, V]) JoinToString added in v0.0.5

func (m ISCMap[K, V]) JoinToString(f func(K, V) string) string

func (ISCMap[K, V]) JoinToStringFull added in v0.0.5

func (m ISCMap[K, V]) JoinToStringFull(sep string, prefix string, postfix string, f func(K, V) string) string

func (ISCMap[K, V]) Keys added in v1.0.0

func (m ISCMap[K, V]) Keys() ISCList[K]

func (ISCMap[K, V]) Minus added in v0.2.0

func (m ISCMap[K, V]) Minus(n map[K]V) ISCMap[K, V]

func (ISCMap[K, V]) None added in v0.0.5

func (m ISCMap[K, V]) None(f func(K, V) bool) bool

func (ISCMap[K, V]) NoneKey added in v0.0.5

func (m ISCMap[K, V]) NoneKey(f func(K) bool) bool

func (ISCMap[K, V]) NoneValue added in v0.0.5

func (m ISCMap[K, V]) NoneValue(f func(V) bool) bool

func (ISCMap[K, V]) Plus added in v0.2.0

func (m ISCMap[K, V]) Plus(n map[K]V) ISCMap[K, V]

func (ISCMap[K, V]) Put added in v0.1.0

func (m ISCMap[K, V]) Put(k K, v V)

func (ISCMap[K, V]) PutAllPairs added in v0.1.0

func (m ISCMap[K, V]) PutAllPairs(item ...Pair[K, V])

func (ISCMap[K, V]) PutPair added in v0.1.0

func (m ISCMap[K, V]) PutPair(item Pair[K, V])

func (ISCMap[K, V]) Size added in v0.6.0

func (m ISCMap[K, V]) Size() int

func (ISCMap[K, V]) ToList added in v0.0.5

func (m ISCMap[K, V]) ToList() []Pair[K, V]

type ISCMapToMap added in v0.0.5

type ISCMapToMap[K comparable, V any, R any] struct {
	ISCMap[K, V]
}

func MapToMapFrom added in v0.0.5

func MapToMapFrom[K comparable, V any, R any](m ISCMap[K, V]) ISCMapToMap[K, V, R]

func (ISCMapToMap[K, V, R]) FlatMap added in v0.0.5

func (m ISCMapToMap[K, V, R]) FlatMap(f func(K, V) []R) ISCList[R]

func (ISCMapToMap[K, V, R]) FlatMapTo added in v0.0.5

func (m ISCMapToMap[K, V, R]) FlatMapTo(dest *[]R, f func(K, V) []R) ISCList[R]

func (ISCMapToMap[K, V, R]) Map added in v0.0.5

func (m ISCMapToMap[K, V, R]) Map(f func(K, V) R) ISCList[R]

func (ISCMapToMap[K, V, R]) MapTo added in v0.0.5

func (m ISCMapToMap[K, V, R]) MapTo(dest *[]R, f func(K, V) R) ISCList[R]

type ISCSet added in v1.0.0

type ISCSet[T comparable] map[T]struct{}

func ListToSet added in v1.5.2

func ListToSet[T comparable](list ISCList[T]) ISCSet[T]

func NewSet added in v1.0.0

func NewSet[T comparable]() ISCSet[T]

NewSet 初始化并指定存储对象的类型

func NewSetWithItems added in v1.0.0

func NewSetWithItems[T comparable](items ...T) ISCSet[T]

func NewSetWithList added in v1.0.0

func NewSetWithList[T comparable](list []T) ISCSet[T]

func (*ISCSet[T]) Add added in v1.0.0

func (s *ISCSet[T]) Add(item T) error

Add 添加元素

func (*ISCSet[T]) AddAll added in v1.0.0

func (s *ISCSet[T]) AddAll(items ...T)

AddAll 添加多个元素

func (*ISCSet[T]) Clear added in v1.0.0

func (s *ISCSet[T]) Clear()

Clear 重置

func (ISCSet[T]) Contains added in v1.0.0

func (s ISCSet[T]) Contains(item T) bool

Contains 判断key是否存在

func (*ISCSet[T]) Delete added in v1.0.0

func (s *ISCSet[T]) Delete(item T) error

Delete 删除指定Key元素

func (ISCSet[T]) Size added in v1.0.0

func (s ISCSet[T]) Size() int

Size 返回数据数量

func (ISCSet[T]) ToList added in v1.0.0

func (s ISCSet[T]) ToList() ISCList[T]

type ISCString added in v0.1.0

type ISCString string

func (ISCString) At added in v0.1.0

func (s ISCString) At(index int) uint8

func (ISCString) Chars added in v1.0.5

func (s ISCString) Chars() ISCList[uint8]

func (ISCString) Contains added in v0.1.0

func (s ISCString) Contains(substr string) bool

func (ISCString) ContainsAny added in v0.1.0

func (s ISCString) ContainsAny(chars string) bool

func (ISCString) ContainsRune added in v0.1.0

func (s ISCString) ContainsRune(r rune) bool

func (ISCString) Count added in v0.1.0

func (s ISCString) Count(substr string) int

func (ISCString) Delete added in v0.1.0

func (s ISCString) Delete(index int, count int) ISCString

func (ISCString) Drop added in v1.0.12

func (s ISCString) Drop(n int) ISCString

func (ISCString) DropLast added in v1.0.12

func (s ISCString) DropLast(n int) ISCString

func (ISCString) EndsWith added in v0.1.0

func (s ISCString) EndsWith(suffix string) bool

func (ISCString) EqualFold added in v0.1.0

func (s ISCString) EqualFold(t string) bool

func (ISCString) Fields added in v0.1.0

func (s ISCString) Fields() []ISCString

func (ISCString) FieldsFunc added in v0.1.0

func (s ISCString) FieldsFunc(f func(rune) bool) []ISCString

func (ISCString) IndexByteOf added in v0.1.0

func (s ISCString) IndexByteOf(c byte) int

func (ISCString) IndexOf added in v0.1.0

func (s ISCString) IndexOf(substr string) int

func (ISCString) IndexOfAny added in v0.1.0

func (s ISCString) IndexOfAny(chars string) int

func (ISCString) IndexOfFunc added in v0.1.0

func (s ISCString) IndexOfFunc(f func(rune) bool) int

func (ISCString) Insert added in v0.1.0

func (s ISCString) Insert(index int, substr string) ISCString

func (ISCString) IsEmpty added in v0.1.0

func (s ISCString) IsEmpty() bool

func (ISCString) LastIndexOf added in v0.1.0

func (s ISCString) LastIndexOf(substr string) int

func (ISCString) LastIndexOfAny added in v0.1.0

func (s ISCString) LastIndexOfAny(chars string) int

func (ISCString) LastIndexOfByte added in v0.1.0

func (s ISCString) LastIndexOfByte(c byte) int

func (ISCString) LastIndexOfFunc added in v0.1.0

func (s ISCString) LastIndexOfFunc(f func(rune) bool) int

func (ISCString) Length added in v0.1.0

func (s ISCString) Length() int

func (ISCString) Lines added in v0.1.0

func (s ISCString) Lines() []ISCString

func (ISCString) LinesNoEmpty added in v0.1.0

func (s ISCString) LinesNoEmpty() []ISCString

func (ISCString) Matches added in v0.1.0

func (s ISCString) Matches(pattern string) bool

func (ISCString) Repeat added in v0.1.0

func (s ISCString) Repeat(count int) ISCString

func (ISCString) Replace added in v0.1.0

func (s ISCString) Replace(old, new string, n int) ISCString

func (ISCString) ReplaceAll added in v0.1.0

func (s ISCString) ReplaceAll(old, new string) ISCString

func (ISCString) Split added in v0.1.0

func (s ISCString) Split(sep string) []ISCString

func (ISCString) SplitAfter added in v0.1.0

func (s ISCString) SplitAfter(sep string) []ISCString

func (ISCString) SplitAfterN added in v0.1.0

func (s ISCString) SplitAfterN(sep string, n int) []ISCString

func (ISCString) SplitN added in v0.1.0

func (s ISCString) SplitN(sep string, n int) []ISCString

func (ISCString) StartsWith added in v0.1.0

func (s ISCString) StartsWith(prefix string) bool

func (ISCString) SubStringAfter added in v0.1.0

func (s ISCString) SubStringAfter(delimiter string) ISCString

func (ISCString) SubStringAfterLast added in v0.1.0

func (s ISCString) SubStringAfterLast(delimiter string) ISCString

func (ISCString) SubStringBefore added in v0.1.0

func (s ISCString) SubStringBefore(delimiter string) ISCString

func (ISCString) SubStringBeforeLast added in v0.1.0

func (s ISCString) SubStringBeforeLast(delimiter string) ISCString

func (ISCString) SubStringStart added in v0.1.0

func (s ISCString) SubStringStart(AStartIndex int) ISCString

func (ISCString) SubStringStartEnd added in v0.1.0

func (s ISCString) SubStringStartEnd(AStartIndex, AEndIndex int) ISCString

func (ISCString) Take added in v1.0.12

func (s ISCString) Take(n int) ISCString

func (ISCString) TakeLast added in v1.0.12

func (s ISCString) TakeLast(n int) ISCString

func (ISCString) ToBoolean added in v0.1.0

func (s ISCString) ToBoolean() bool

func (ISCString) ToCookieMap added in v0.7.4

func (s ISCString) ToCookieMap() ISCMap[ISCString, ISCString]

func (ISCString) ToFloat added in v0.1.0

func (s ISCString) ToFloat() float32

func (ISCString) ToFloat64 added in v0.1.0

func (s ISCString) ToFloat64() float64

func (ISCString) ToInt added in v0.1.0

func (s ISCString) ToInt() int

func (ISCString) ToInt16 added in v1.0.5

func (s ISCString) ToInt16() int16

func (ISCString) ToInt32 added in v1.0.5

func (s ISCString) ToInt32() int32

func (ISCString) ToInt64 added in v0.1.0

func (s ISCString) ToInt64() int64

func (ISCString) ToInt8 added in v1.0.5

func (s ISCString) ToInt8() int8

func (ISCString) ToIntRadix added in v1.0.5

func (s ISCString) ToIntRadix(radix int) (int64, error)

func (ISCString) ToJSONEncoded added in v0.7.4

func (s ISCString) ToJSONEncoded() ISCString

func (ISCString) ToLower added in v0.1.0

func (s ISCString) ToLower() ISCString

func (ISCString) ToMap added in v0.7.4

func (s ISCString) ToMap() ISCMap[ISCString, ISCString]

func (ISCString) ToPair added in v0.7.4

func (s ISCString) ToPair() Pair[ISCString, ISCString]

func (ISCString) ToTitle added in v0.1.0

func (s ISCString) ToTitle() ISCString

func (ISCString) ToUpper added in v0.1.0

func (s ISCString) ToUpper() ISCString

func (ISCString) Trim added in v0.1.0

func (s ISCString) Trim(cutset string) ISCString

func (ISCString) TrimFunc added in v0.1.0

func (s ISCString) TrimFunc(f func(rune) bool) ISCString

func (ISCString) TrimLeft added in v0.1.0

func (s ISCString) TrimLeft(cutset string) ISCString

func (ISCString) TrimLeftFunc added in v0.1.0

func (s ISCString) TrimLeftFunc(f func(rune) bool) ISCString

func (ISCString) TrimPrefix added in v0.1.0

func (s ISCString) TrimPrefix(prefix string) ISCString

func (ISCString) TrimRight added in v0.1.0

func (s ISCString) TrimRight(cutset string) ISCString

func (ISCString) TrimRightFunc added in v0.1.0

func (s ISCString) TrimRightFunc(f func(rune) bool) ISCString

func (ISCString) TrimSpace added in v0.1.0

func (s ISCString) TrimSpace() ISCString

func (ISCString) TrimSuffix added in v0.1.0

func (s ISCString) TrimSuffix(suffix string) ISCString

type ISCUTF8String added in v1.0.5

type ISCUTF8String []rune

func NewUTF8String added in v1.0.5

func NewUTF8String(str string) ISCUTF8String

func (ISCUTF8String) At added in v1.0.5

func (s ISCUTF8String) At(index int) rune

func (ISCUTF8String) Chars added in v1.0.5

func (s ISCUTF8String) Chars() ISCList[rune]

func (ISCUTF8String) Contains added in v1.0.5

func (s ISCUTF8String) Contains(substr ISCUTF8String) bool

func (ISCUTF8String) ContainsRune added in v1.0.5

func (s ISCUTF8String) ContainsRune(r rune) bool

func (ISCUTF8String) Count added in v1.0.5

func (s ISCUTF8String) Count(substr ISCUTF8String) int

func (ISCUTF8String) Delete added in v1.0.5

func (s ISCUTF8String) Delete(index int, count int) ISCUTF8String

func (ISCUTF8String) EndsWith added in v1.0.5

func (s ISCUTF8String) EndsWith(suffix ISCUTF8String) bool

func (ISCUTF8String) EqualFold added in v1.0.5

func (s ISCUTF8String) EqualFold(t ISCUTF8String) bool

func (ISCUTF8String) Fields added in v1.0.5

func (s ISCUTF8String) Fields() []ISCUTF8String

func (ISCUTF8String) FieldsFunc added in v1.0.5

func (s ISCUTF8String) FieldsFunc(f func(rune) bool) []ISCUTF8String

func (ISCUTF8String) IndexOf added in v1.0.5

func (s ISCUTF8String) IndexOf(substr ISCUTF8String) int

func (ISCUTF8String) IndexOfFunc added in v1.0.5

func (s ISCUTF8String) IndexOfFunc(f func(rune) bool) int

func (ISCUTF8String) Insert added in v1.0.5

func (s ISCUTF8String) Insert(index int, substr ISCUTF8String) ISCUTF8String

func (ISCUTF8String) IsEmpty added in v1.0.5

func (s ISCUTF8String) IsEmpty() bool

func (ISCUTF8String) LastIndexOf added in v1.0.5

func (s ISCUTF8String) LastIndexOf(substr ISCUTF8String) int

func (ISCUTF8String) LastIndexOfFunc added in v1.0.5

func (s ISCUTF8String) LastIndexOfFunc(f func(rune) bool) int

func (ISCUTF8String) Length added in v1.0.5

func (s ISCUTF8String) Length() int

func (ISCUTF8String) Lines added in v1.0.5

func (s ISCUTF8String) Lines() []ISCUTF8String

func (ISCUTF8String) LinesNoEmpty added in v1.0.5

func (s ISCUTF8String) LinesNoEmpty() []ISCUTF8String

func (ISCUTF8String) Matches added in v1.0.5

func (s ISCUTF8String) Matches(pattern ISCUTF8String) bool

func (ISCUTF8String) Replace added in v1.0.5

func (s ISCUTF8String) Replace(old, new ISCUTF8String, n int) ISCUTF8String

func (ISCUTF8String) ReplaceAll added in v1.0.5

func (s ISCUTF8String) ReplaceAll(old, new ISCUTF8String) ISCUTF8String

func (ISCUTF8String) Split added in v1.0.5

func (s ISCUTF8String) Split(sep ISCUTF8String) []ISCUTF8String

func (ISCUTF8String) SplitAfter added in v1.0.5

func (s ISCUTF8String) SplitAfter(sep ISCUTF8String) []ISCUTF8String

func (ISCUTF8String) SplitAfterN added in v1.0.5

func (s ISCUTF8String) SplitAfterN(sep ISCUTF8String, n int) []ISCUTF8String

func (ISCUTF8String) SplitN added in v1.0.5

func (s ISCUTF8String) SplitN(sep ISCUTF8String, n int) []ISCUTF8String

func (ISCUTF8String) StartsWith added in v1.0.5

func (s ISCUTF8String) StartsWith(prefix ISCUTF8String) bool

func (ISCUTF8String) String added in v1.0.5

func (s ISCUTF8String) String() string

func (ISCUTF8String) SubStringAfter added in v1.0.5

func (s ISCUTF8String) SubStringAfter(delimiter ISCUTF8String) ISCUTF8String

func (ISCUTF8String) SubStringAfterLast added in v1.0.5

func (s ISCUTF8String) SubStringAfterLast(delimiter ISCUTF8String) ISCUTF8String

func (ISCUTF8String) SubStringBefore added in v1.0.5

func (s ISCUTF8String) SubStringBefore(delimiter ISCUTF8String) ISCUTF8String

func (ISCUTF8String) SubStringBeforeLast added in v1.0.5

func (s ISCUTF8String) SubStringBeforeLast(delimiter ISCUTF8String) ISCUTF8String

func (ISCUTF8String) SubStringStart added in v1.0.5

func (s ISCUTF8String) SubStringStart(AStartIndex int) ISCUTF8String

func (ISCUTF8String) SubStringStartEnd added in v1.0.5

func (s ISCUTF8String) SubStringStartEnd(AStartIndex, AEndIndex int) ISCUTF8String

func (ISCUTF8String) ToBoolean added in v1.0.5

func (s ISCUTF8String) ToBoolean() bool

func (ISCUTF8String) ToFloat added in v1.0.5

func (s ISCUTF8String) ToFloat() float32

func (ISCUTF8String) ToFloat64 added in v1.0.5

func (s ISCUTF8String) ToFloat64() float64

func (ISCUTF8String) ToInt added in v1.0.5

func (s ISCUTF8String) ToInt() int

func (ISCUTF8String) ToInt16 added in v1.0.5

func (s ISCUTF8String) ToInt16() int16

func (ISCUTF8String) ToInt32 added in v1.0.5

func (s ISCUTF8String) ToInt32() int32

func (ISCUTF8String) ToInt64 added in v1.0.5

func (s ISCUTF8String) ToInt64() int64

func (ISCUTF8String) ToInt8 added in v1.0.5

func (s ISCUTF8String) ToInt8() int8

func (ISCUTF8String) ToIntRadix added in v1.0.5

func (s ISCUTF8String) ToIntRadix(radix int) (int64, error)

func (ISCUTF8String) ToJSONEncoded added in v1.0.5

func (s ISCUTF8String) ToJSONEncoded() ISCUTF8String

func (ISCUTF8String) ToLower added in v1.0.5

func (s ISCUTF8String) ToLower() ISCUTF8String

func (ISCUTF8String) ToPair added in v1.0.5

func (ISCUTF8String) ToTitle added in v1.0.5

func (s ISCUTF8String) ToTitle() ISCUTF8String

func (ISCUTF8String) ToUpper added in v1.0.5

func (s ISCUTF8String) ToUpper() ISCUTF8String

func (ISCUTF8String) Trim added in v1.0.5

func (s ISCUTF8String) Trim(cutset ISCUTF8String) ISCUTF8String

func (ISCUTF8String) TrimFunc added in v1.0.5

func (s ISCUTF8String) TrimFunc(f func(rune) bool) ISCUTF8String

func (ISCUTF8String) TrimLeft added in v1.0.5

func (s ISCUTF8String) TrimLeft(cutset ISCUTF8String) ISCUTF8String

func (ISCUTF8String) TrimLeftFunc added in v1.0.5

func (s ISCUTF8String) TrimLeftFunc(f func(rune) bool) ISCUTF8String

func (ISCUTF8String) TrimPrefix added in v1.0.5

func (s ISCUTF8String) TrimPrefix(prefix ISCUTF8String) ISCUTF8String

func (ISCUTF8String) TrimRight added in v1.0.5

func (s ISCUTF8String) TrimRight(cutset ISCUTF8String) ISCUTF8String

func (ISCUTF8String) TrimRightFunc added in v1.0.5

func (s ISCUTF8String) TrimRightFunc(f func(rune) bool) ISCUTF8String

func (ISCUTF8String) TrimSpace added in v1.0.5

func (s ISCUTF8String) TrimSpace() ISCUTF8String

func (ISCUTF8String) TrimSuffix added in v1.0.5

func (s ISCUTF8String) TrimSuffix(suffix ISCUTF8String) ISCUTF8String

type IntRange

type IntRange struct {
	Start int
	End   int
}

func MakeIntRange

func MakeIntRange(AStart int, AEnd int) IntRange

type LinkedHashMap added in v0.6.0

type LinkedHashMap[K comparable, V comparable] OrderMap[K, V]

type MapPair added in v1.0.0

type MapPair[K comparable, V comparable] struct {
	Key   K
	Value V
}

func OrderMapToList added in v1.0.0

func OrderMapToList[K comparable, V comparable](m OrderMap[K, V]) []MapPair[K, V]

type OrderMap added in v0.6.0

type OrderMap[K comparable, V comparable] struct {
	Data    map[K]V
	KeyList []K
}

func NewOrderMap added in v0.6.0

func NewOrderMap[K comparable, V comparable]() OrderMap[K, V]

func (OrderMap[K, V]) All added in v0.6.0

func (m OrderMap[K, V]) All(f func(K, V) bool) bool

func (OrderMap[K, V]) AllKey added in v0.6.0

func (m OrderMap[K, V]) AllKey(f func(K) bool) bool

func (OrderMap[K, V]) AllValue added in v0.6.0

func (m OrderMap[K, V]) AllValue(f func(V) bool) bool

func (OrderMap[K, V]) Any added in v0.6.0

func (m OrderMap[K, V]) Any(f func(K, V) bool) bool

func (OrderMap[K, V]) AnyKey added in v0.6.0

func (m OrderMap[K, V]) AnyKey(f func(K) bool) bool

func (OrderMap[K, V]) AnyValue added in v0.6.0

func (m OrderMap[K, V]) AnyValue(f func(V) bool) bool

func (*OrderMap[K, V]) Clear added in v0.6.0

func (m *OrderMap[K, V]) Clear()

func (OrderMap[K, V]) Contains added in v0.6.0

func (m OrderMap[K, V]) Contains(k K, v V) bool

func (OrderMap[K, V]) ContainsKey added in v0.6.0

func (m OrderMap[K, V]) ContainsKey(k K) bool

func (OrderMap[K, V]) ContainsValue added in v0.6.0

func (m OrderMap[K, V]) ContainsValue(v V) bool

func (OrderMap[K, V]) Count added in v0.6.0

func (m OrderMap[K, V]) Count(f func(K, V) bool) int

func (OrderMap[K, V]) CountKey added in v0.6.0

func (m OrderMap[K, V]) CountKey(f func(K) bool) int

func (OrderMap[K, V]) CountValue added in v0.6.0

func (m OrderMap[K, V]) CountValue(f func(V) bool) int

func (*OrderMap[K, V]) Delete added in v0.6.0

func (m *OrderMap[K, V]) Delete(k K)

func (OrderMap[K, V]) Filter added in v0.6.0

func (m OrderMap[K, V]) Filter(f func(K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterIndexed added in v0.6.0

func (m OrderMap[K, V]) FilterIndexed(f func(int, K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterIndexedTo added in v0.6.0

func (m OrderMap[K, V]) FilterIndexedTo(dest *OrderMap[K, V], f func(int, K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterKeys added in v0.6.0

func (m OrderMap[K, V]) FilterKeys(f func(K) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterKeysIndexed added in v0.6.0

func (m OrderMap[K, V]) FilterKeysIndexed(f func(int, K) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterNot added in v0.6.0

func (m OrderMap[K, V]) FilterNot(f func(K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterNotIndexed added in v0.6.0

func (m OrderMap[K, V]) FilterNotIndexed(f func(int, K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterNotIndexedTo added in v0.6.0

func (m OrderMap[K, V]) FilterNotIndexedTo(dest *OrderMap[K, V], f func(int, K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterNotTo added in v0.6.0

func (m OrderMap[K, V]) FilterNotTo(dest *OrderMap[K, V], f func(K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterTo added in v0.6.0

func (m OrderMap[K, V]) FilterTo(dest *OrderMap[K, V], f func(K, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterValues added in v0.6.0

func (m OrderMap[K, V]) FilterValues(f func(V) bool) OrderMap[K, V]

func (OrderMap[K, V]) FilterValuesIndexed added in v0.6.0

func (m OrderMap[K, V]) FilterValuesIndexed(f func(int, V) bool) OrderMap[K, V]

func (OrderMap[K, V]) ForEach added in v0.6.0

func (m OrderMap[K, V]) ForEach(f func(K, V))

func (OrderMap[K, V]) ForEachIndexed added in v0.6.0

func (m OrderMap[K, V]) ForEachIndexed(f func(int, K, V))

func (OrderMap[K, V]) Get added in v0.6.0

func (m OrderMap[K, V]) Get(k K) V

func (OrderMap[K, V]) GetKey added in v0.6.0

func (m OrderMap[K, V]) GetKey(index int) K

func (OrderMap[K, V]) GetOrDef added in v0.6.0

func (m OrderMap[K, V]) GetOrDef(k K, def V) V

func (OrderMap[K, V]) GetValue added in v0.6.0

func (m OrderMap[K, V]) GetValue(index int) V

func (OrderMap[K, V]) JoinToString added in v0.6.0

func (m OrderMap[K, V]) JoinToString(f func(K, V) string) string

func (OrderMap[K, V]) JoinToStringFull added in v0.6.0

func (m OrderMap[K, V]) JoinToStringFull(sep string, prefix string, postfix string, f func(K, V) string) string

func (OrderMap[K, V]) Keys added in v0.6.0

func (m OrderMap[K, V]) Keys() []K

func (OrderMap[K, V]) Minus added in v0.6.0

func (m OrderMap[K, V]) Minus(n OrderMap[K, V]) OrderMap[K, V]

func (OrderMap[K, V]) None added in v0.6.0

func (m OrderMap[K, V]) None(f func(K, V) bool) bool

func (OrderMap[K, V]) NoneKey added in v0.6.0

func (m OrderMap[K, V]) NoneKey(f func(K) bool) bool

func (OrderMap[K, V]) NoneValue added in v0.6.0

func (m OrderMap[K, V]) NoneValue(f func(V) bool) bool

func (OrderMap[K, V]) Plus added in v0.6.0

func (m OrderMap[K, V]) Plus(n OrderMap[K, V]) OrderMap[K, V]

func (*OrderMap[K, V]) Put added in v0.6.0

func (m *OrderMap[K, V]) Put(k K, v V)

func (*OrderMap[K, V]) PutPair added in v0.6.0

func (m *OrderMap[K, V]) PutPair(item Pair[K, V])

func (*OrderMap[K, V]) PutPairs added in v0.6.0

func (m *OrderMap[K, V]) PutPairs(item ...Pair[K, V])

func (OrderMap[K, V]) Size added in v0.6.0

func (m OrderMap[K, V]) Size() int

func (OrderMap[K, V]) ToList added in v0.6.0

func (m OrderMap[K, V]) ToList() []Pair[K, V]

type Pair added in v0.0.5

type Pair[A any, B any] struct {
	First  A
	Second B
}

func MapToList added in v0.0.5

func MapToList[K comparable, V any](m map[K]V) []Pair[K, V]

func NewPair added in v0.0.5

func NewPair[A any, B any](a A, b B) Pair[A, B]

type Properties

type Properties struct {
	Value map[string]string
}

type Queue added in v1.4.1

type Queue struct {
	// contains filtered or unexported fields
}

func NewQueue added in v1.4.1

func NewQueue() *Queue

func (*Queue) Num added in v1.4.1

func (queue *Queue) Num() int32

func (*Queue) Offer added in v1.4.1

func (queue *Queue) Offer(value interface{}) (num int32)

func (*Queue) Peek added in v1.4.1

func (queue *Queue) Peek() (value interface{}, num int32)

func (*Queue) Poll added in v1.4.1

func (queue *Queue) Poll() (value interface{}, num int32)

func (*Queue) Take added in v1.4.1

func (queue *Queue) Take(duration t0.Duration) (value interface{}, num int32)

type Stream added in v0.3.0

type Stream[T any] struct {
	// contains filtered or unexported fields
}

A Stream is a stream that can be used to do stream processing.

func StreamJust added in v0.6.0

func StreamJust[T any](items ...T) Stream[T]

StreamJust converts the given arbitrary items to a Stream.

func StreamRange added in v0.6.0

func StreamRange[T any](source <-chan T) Stream[T]

func (Stream[T]) AllMatch added in v0.3.0

func (s Stream[T]) AllMatch(predicate func(T) bool) bool

AllMatch returns whether all elements of this stream match the provided predicate. May not evaluate the predicate on all elements if not necessary for determining the result. If the stream is empty then true is returned and the predicate is not evaluated.

func (Stream[T]) AnyMatch added in v0.3.0

func (s Stream[T]) AnyMatch(predicate func(T) bool) bool

AnyMatch returns whether any elements of this stream match the provided predicate. May not evaluate the predicate on all elements if not necessary for determining the result. If the stream is empty then false is returned and the predicate is not evaluated.

func (Stream[T]) Distinct added in v0.3.0

func (s Stream[T]) Distinct(keySelector func(T) T) Stream[T]

Distinct removes the duplicated items base on the given keySelector.

func (Stream[T]) Done added in v0.3.0

func (s Stream[T]) Done()

Done waits all upstreaming operations to be done.

func (Stream[T]) Filter added in v0.3.0

func (s Stream[T]) Filter(predicate func(T) bool) Stream[T]

Filter Returns a list containing only elements matching the given predicate.

func (Stream[T]) FirsVal added in v0.3.0

func (s Stream[T]) FirsVal() any

FirsVal returns the first element,channel is FIFO,so first goroutine will get head element or nil

func (Stream[T]) First added in v0.3.0

func (s Stream[T]) First(valueSelector func(T) bool) Stream[T]

First returns the first element,channel is FIFO,so first goroutine will get head element

func (Stream[T]) ForEach added in v0.6.0

func (s Stream[T]) ForEach(fn func(T))

ForEach seals the Stream with the fn on each item, no successive operations.

func (Stream[T]) Last added in v0.3.0

func (s Stream[T]) Last(valueSelector func(any) bool) Stream[T]

Last returns the last item, or nil if no items.

func (Stream[T]) LastVal added in v0.3.0

func (s Stream[T]) LastVal() (item T)

LastVal returns the last item, or nil if no items.

func (Stream[T]) Map added in v0.3.0

func (s Stream[T]) Map(fn func(T) T) Stream[T]

func (Stream[T]) NoneMatch added in v0.3.0

func (s Stream[T]) NoneMatch(predicate func(T) bool) bool

NoneMatch returns whether all elements of this stream don't match the provided predicate. May not evaluate the predicate on all elements if not necessary for determining the result. If the stream is empty then true is returned and the predicate is not evaluated.

func (Stream[T]) Sort added in v0.3.0

func (s Stream[T]) Sort(less func(T, T) bool) Stream[T]

Sort sorts the items from the underlying source.

type StringPair

type StringPair struct {
	Left  string
	Right string
}

func YamlToKvList

func YamlToKvList(contentOfYaml string) ([]StringPair, error)

type Triple added in v0.0.5

type Triple[A any, B any, C any] struct {
	First  A
	Second B
	Third  C
}

func NewTriple added in v0.0.5

func NewTriple[A any, B any, C any](a A, b B, c C) Triple[A, B, C]

type TypeEnum

type TypeEnum int8
const (
	TeYAML       TypeEnum = 0
	TePROPERTIES TypeEnum = 1
	TeJSON       TypeEnum = 2
	TeSTRING     TypeEnum = 3
)

type YamlNode

type YamlNode struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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