types

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 19 Imported by: 6

Documentation

Index

Constants

View Source
const (
	NullSeparator   = "\u0000"
	NBSPSeparator   = "\u00A0"
	ZWNBSPSeparator = "\uFEFF"
)
View Source
const (
	TagQuodLibetMemo = "QuodLibet::memo"
)

Variables

This section is empty.

Functions

func CutInvisibleSeparator

func CutInvisibleSeparator(input string) string

func ReplaceInvisibleSeparator

func ReplaceInvisibleSeparator(input, replace string) string

Types

type DateTime

type DateTime struct {
	carbon.Carbon
}

func NewDateTime

func NewDateTime(tt ...string) *DateTime

func (*DateTime) CenturyEndTime

func (d *DateTime) CenturyEndTime() time.Time

func (*DateTime) CenturyStartTime

func (d *DateTime) CenturyStartTime() time.Time

func (*DateTime) Christmas

func (d *DateTime) Christmas() time.Time

func (*DateTime) DayEndTime

func (d *DateTime) DayEndTime() time.Time

func (*DateTime) DayStartTime

func (d *DateTime) DayStartTime() time.Time

func (*DateTime) DecadeEndTime

func (d *DateTime) DecadeEndTime() time.Time

func (*DateTime) DecadeStartTime

func (d *DateTime) DecadeStartTime() time.Time

func (*DateTime) EndOfTenMinutes

func (d *DateTime) EndOfTenMinutes() time.Time

func (*DateTime) FirstSundayOfMonth

func (d *DateTime) FirstSundayOfMonth() time.Time

func (*DateTime) FirstSundayOfYear

func (d *DateTime) FirstSundayOfYear() time.Time

func (*DateTime) FirstWeekdayOfMonth

func (d *DateTime) FirstWeekdayOfMonth(weekday time.Weekday) time.Time

func (*DateTime) FirstWeekdayOfYear

func (d *DateTime) FirstWeekdayOfYear(weekday time.Weekday) time.Time

func (*DateTime) HourEndTime

func (d *DateTime) HourEndTime() time.Time

func (*DateTime) HourStartTime

func (d *DateTime) HourStartTime() time.Time

func (*DateTime) LastSundayOfMonth

func (d *DateTime) LastSundayOfMonth() time.Time

func (*DateTime) LastSundayOfYear

func (d *DateTime) LastSundayOfYear() time.Time

func (*DateTime) LastWeekdayOfMonth

func (d *DateTime) LastWeekdayOfMonth(weekday time.Weekday) time.Time

func (*DateTime) LastWeekdayOfYear

func (d *DateTime) LastWeekdayOfYear(weekday time.Weekday) time.Time

func (*DateTime) MinuteEndTime

func (d *DateTime) MinuteEndTime() time.Time

func (*DateTime) MinuteStartTime

func (d *DateTime) MinuteStartTime() time.Time

func (*DateTime) MonthEndTime

func (d *DateTime) MonthEndTime() time.Time

func (*DateTime) MonthStartTime

func (d *DateTime) MonthStartTime() time.Time

func (*DateTime) QuarterEndTime

func (d *DateTime) QuarterEndTime() time.Time

func (*DateTime) QuarterStartTime

func (d *DateTime) QuarterStartTime() time.Time

func (*DateTime) SeasonEndTime

func (d *DateTime) SeasonEndTime() time.Time

func (*DateTime) SeasonStartTime

func (d *DateTime) SeasonStartTime() time.Time

func (*DateTime) StartOfTenMinutes

func (d *DateTime) StartOfTenMinutes() time.Time

func (*DateTime) String

func (d *DateTime) String() string

func (*DateTime) TheDayIsFirstSundayOfMonth

func (d *DateTime) TheDayIsFirstSundayOfMonth() bool

func (*DateTime) WeekEndTime

func (d *DateTime) WeekEndTime() time.Time

func (*DateTime) WeekStartTime

func (d *DateTime) WeekStartTime() time.Time

func (*DateTime) YearEndTime

func (d *DateTime) YearEndTime() time.Time

func (*DateTime) YearStartTime

func (d *DateTime) YearStartTime() time.Time

type Entity added in v1.1.9

type Entity[T any] interface {
	Scan(v T) error
	Model() T
}

type Entry added in v1.1.8

type Entry[V comparable] struct {
	Value V      `json:"value"`
	Msg   string `json:"msg"`
}

func (*Entry[V]) String added in v1.1.8

func (e *Entry[V]) String() string

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type H

type H = Map[any]

type Hash

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

func (Hash[K, V]) Clone added in v1.2.0

func (h Hash[K, V]) Clone() Hash[K, V]

func (Hash[K, V]) ForEach

func (h Hash[K, V]) ForEach(f func(K, V))

func (Hash[K, V]) Get

func (h Hash[K, V]) Get(key K) (V, bool)

func (Hash[K, V]) HasKey

func (h Hash[K, V]) HasKey(k K) bool

func (Hash[K, V]) IsEmpty

func (h Hash[K, V]) IsEmpty() bool

func (Hash[K, V]) Keys

func (h Hash[K, V]) Keys() []K

func (Hash[K, V]) Len

func (h Hash[K, V]) Len() int

func (Hash[K, V]) MarshalBinary

func (h Hash[K, V]) MarshalBinary() (data []byte, err error)

func (Hash[K, V]) ParallelForEach

func (h Hash[K, V]) ParallelForEach(f func(K, V))

func (Hash[K, V]) Set

func (h Hash[K, V]) Set(k K, v V)

func (Hash[K, V]) String

func (h Hash[K, V]) String() string

func (Hash[K, V]) UnmarshalBinary

func (h Hash[K, V]) UnmarshalBinary(data []byte) error

func (Hash[K, V]) Values

func (h Hash[K, V]) Values() []V

type IMap

type IMap[K comparable, V any] interface {
	Len() int
	Keys() []K
	Values() []V
	IsEmpty() bool
	HasKey(K) bool
	Get(key K) (V, bool)
	Set(k K, v V)
	ForEach(func(K, V))
	ParallelForEach(func(K, V))
}

type ISlice

type ISlice[T comparable] interface {
	Len() int
	IsEmpty() bool
	Count(v T) int
	Contain(v T) bool
	Random() T
	Shuffle()
	Find(f func(T) bool) (T, bool)
	ForEach(f func(T, int))
	ParallelForEach(f func(T, int))
}

type MP3

type MP3 struct {
	OriginFile string  `json:"origin_file"`
	BPM        string  `json:"bpm"`
	Title      string  `json:"title"`
	Artist     string  `json:"artist"`
	Album      string  `json:"album"`
	Memo       string  `json:"memo"`
	Length     float64 `json:"length"`
}

func NewMP3

func NewMP3(name string) (*MP3, error)

func (*MP3) Init

func (m *MP3) Init() (*MP3, error)

func (*MP3) LoadLength

func (m *MP3) LoadLength() error

func (*MP3) String

func (m *MP3) String() string

type Map

type Map[V any] map[string]V

func (Map[V]) Clone added in v1.2.0

func (m Map[V]) Clone() Map[V]

func (Map[V]) ForEach

func (m Map[V]) ForEach(f func(string, V))

func (Map[V]) Get

func (m Map[V]) Get(key string) (V, bool)

func (Map[V]) HasKey

func (m Map[V]) HasKey(k string) bool

func (Map[V]) IsEmpty

func (m Map[V]) IsEmpty() bool

func (Map[V]) Keys

func (m Map[V]) Keys() []string

func (Map[V]) Len

func (m Map[V]) Len() int

func (Map[V]) MarshalBinary

func (m Map[V]) MarshalBinary() (data []byte, err error)

func (Map[V]) ParallelForEach

func (m Map[V]) ParallelForEach(f func(string, V))

func (Map[V]) Set

func (m Map[V]) Set(k string, v V)

func (Map[V]) String

func (m Map[V]) String() string

func (Map[V]) UnmarshalBinary

func (m Map[V]) UnmarshalBinary(data []byte) error

func (Map[V]) Values

func (m Map[V]) Values() []V

type RedisValue added in v1.1.9

type RedisValue interface {
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
}

RedisValue

@Description:	凡是存储在redis中的结构体,都需要实现这个接口

type Slice

type Slice[T comparable] []T

func (Slice[T]) Clone

func (s Slice[T]) Clone() Slice[T]

func (Slice[T]) Contain

func (s Slice[T]) Contain(v T) bool

func (Slice[T]) Count

func (s Slice[T]) Count(v T) int

func (Slice[T]) Find

func (s Slice[T]) Find(f func(T) bool) (T, bool)

func (Slice[T]) ForEach

func (s Slice[T]) ForEach(f func(T, int))

func (Slice[T]) IsEmpty

func (s Slice[T]) IsEmpty() bool

func (Slice[T]) Len

func (s Slice[T]) Len() int

func (Slice[T]) MarshalBinary

func (s Slice[T]) MarshalBinary() (data []byte, err error)

func (Slice[T]) ParallelForEach

func (s Slice[T]) ParallelForEach(f func(T, int))

func (Slice[T]) Random

func (s Slice[T]) Random() T

func (Slice[T]) Shuffle

func (s Slice[T]) Shuffle()

func (Slice[T]) Sort

func (s Slice[T]) Sort(less func(i, j int) bool)

func (Slice[T]) String

func (s Slice[T]) String() string

func (Slice[T]) Swap

func (s Slice[T]) Swap(i, j int)

func (Slice[T]) UnmarshalBinary

func (s Slice[T]) UnmarshalBinary(data []byte) error

type ValueMessage added in v1.1.7

type ValueMessage[K constraints.Ordered] map[K]string

func (ValueMessage[K]) Clone added in v1.2.0

func (msg ValueMessage[K]) Clone() ValueMessage[K]

func (ValueMessage[K]) ForEach added in v1.1.7

func (msg ValueMessage[K]) ForEach(f func(K, string))

func (ValueMessage[K]) Get added in v1.1.7

func (msg ValueMessage[K]) Get(key K) (string, bool)

func (ValueMessage[K]) HasKey added in v1.1.7

func (msg ValueMessage[K]) HasKey(k K) bool

func (ValueMessage[K]) IsEmpty added in v1.1.7

func (msg ValueMessage[K]) IsEmpty() bool

func (ValueMessage[K]) Keys added in v1.1.7

func (msg ValueMessage[K]) Keys() []K

func (ValueMessage[K]) Len added in v1.1.7

func (msg ValueMessage[K]) Len() int

func (ValueMessage[K]) ParallelForEach added in v1.1.7

func (msg ValueMessage[K]) ParallelForEach(f func(K, string))

func (ValueMessage[K]) Set added in v1.1.7

func (msg ValueMessage[K]) Set(k K, v string)

func (ValueMessage[K]) ToSortedSlice added in v1.1.7

func (msg ValueMessage[K]) ToSortedSlice() Slice[*Entry[K]]

func (ValueMessage[K]) Values added in v1.1.7

func (msg ValueMessage[K]) Values() []string

Jump to

Keyboard shortcuts

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