fstypes

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SliceMerge added in v0.0.5

func SliceMerge[T any](a []T, b []T) []T

Types

type Complex added in v0.0.5

type Complex interface {
	~complex64 | ~complex128
}

type EnableStatus added in v0.0.5

type EnableStatus int32

EnableStatus enable and disable status, default value is enable

func (*EnableStatus) Disable added in v0.0.5

func (es *EnableStatus) Disable()

Disable set status disable

func (*EnableStatus) Enable added in v0.0.5

func (es *EnableStatus) Enable()

Enable set status enable

func (*EnableStatus) IsEnable added in v0.0.5

func (es *EnableStatus) IsEnable() bool

IsEnable return is enable

func (*EnableStatus) SetEnable added in v0.0.5

func (es *EnableStatus) SetEnable(enable bool)

SetEnable set status

func (*EnableStatus) String added in v0.0.5

func (es *EnableStatus) String() string

String return status desc

type Float added in v0.0.5

type Float interface {
	~float32 | ~float64
}

type GroupEnableStatus added in v0.0.5

type GroupEnableStatus struct {

	// Default 未设置时的默认值
	Default bool
	// contains filtered or unexported fields
}

GroupEnableStatus 一组状态,默认未设置会返回 false

func (*GroupEnableStatus) IsEnable added in v0.0.5

func (gs *GroupEnableStatus) IsEnable(key any) bool

IsEnable 获取状态

func (*GroupEnableStatus) Range added in v0.0.5

func (gs *GroupEnableStatus) Range(fn func(key any, enable bool) bool)

Range 遍历所有已设置的值

func (*GroupEnableStatus) SetAllEnable added in v0.0.5

func (gs *GroupEnableStatus) SetAllEnable(enable bool)

SetAllEnable 设置所有的状态,设置后,也会调整默认状态为此值

如 默认值为 false,若 key="key123" 未设置,调用 IsEnable("key123") 会返回 false,
当 SetAllEnable(true) 之后,再次调用 IsEnable("key123") 会返回 true

func (*GroupEnableStatus) SetEnable added in v0.0.5

func (gs *GroupEnableStatus) SetEnable(key any, enable bool)

SetEnable 设置状态

func (*GroupEnableStatus) String added in v0.0.5

func (gs *GroupEnableStatus) String() string

String 打印出所有已经设置的状态信息

type Integer added in v0.0.5

type Integer interface {
	Signed | Unsigned
}

type Ordered added in v0.0.5

type Ordered interface {
	Integer | Float | ~string
}

type Signed added in v0.0.5

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type String

type String string

String 字符串

func (String) Int16Slice added in v0.0.5

func (s String) Int16Slice(sep string) ([]int16, error)

Int16Slice 转换为 []int16

func (String) Int32Slice added in v0.0.5

func (s String) Int32Slice(sep string) ([]int32, error)

Int32Slice 转换为 []int32

func (String) Int64Slice added in v0.0.5

func (s String) Int64Slice(sep string) ([]int64, error)

Int64Slice 转换为 []int32

func (String) Int8Slice added in v0.0.5

func (s String) Int8Slice(sep string) ([]int8, error)

Int8Slice 转换为 []int8

func (String) IntSlice added in v0.0.5

func (s String) IntSlice(sep string) ([]int, error)

IntSlice 转换为 []int

func (String) Split

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

Split 转换为 []string 会剔除掉空字符串,如 `a, c,` -> []string{"a","c"}

func (String) Uint16Slice added in v0.0.5

func (s String) Uint16Slice(sep string) ([]uint16, error)

Uint16Slice 转换为 []uint16

func (String) Uint32Slice added in v0.0.5

func (s String) Uint32Slice(sep string) ([]uint32, error)

Uint32Slice 转换为 []uint32

func (String) Uint64Slice added in v0.0.5

func (s String) Uint64Slice(sep string) ([]uint64, error)

Uint64Slice 转换为 []uint64

func (String) Uint8Slice added in v0.0.5

func (s String) Uint8Slice(sep string) ([]uint8, error)

Uint8Slice 转换为 []uint8

func (String) UintSlice added in v0.0.5

func (s String) UintSlice(sep string) ([]uint, error)

UintSlice 转换为 []uint

type StringSlice

type StringSlice []string

StringSlice alias off []string

func (*StringSlice) Delete added in v0.0.5

func (ss *StringSlice) Delete(values ...string)

Delete 删除对应的值

func (StringSlice) Has added in v0.0.5

func (ss StringSlice) Has(value string) bool

Has 是否包含指定的值

func (StringSlice) Unique

func (ss StringSlice) Unique() StringSlice

Unique uniq

type Unsigned added in v0.0.5

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Jump to

Keyboard shortcuts

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