basic

package
v0.0.0-...-e27862a Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat  = "2006-01-02 15:04:05"
	TimeFormatT = "2006-01-02T15:04:05"
)

Variables

View Source
var (
	TimePattern1 *regexp.Regexp
	TimePattern2 *regexp.Regexp
	TimePattern3 *regexp.Regexp
	TimePattern4 *regexp.Regexp
	TimePattern5 *regexp.Regexp
)

Functions

func GetClassName

func GetClassName(v interface{}) string

Types

type Class

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

Class 声明类

func NewClass

func NewClass(cls interface{}) *Class

NewClass 实例化

func (*Class) GetAllMethod

func (c *Class) GetAllMethod() []*Method

GetAllMethod 获得此类中所有方法

func (*Class) GetMethod

func (c *Class) GetMethod(methodName string) *Method

GetMethod 根据方法名称获得方法,如:pkg.funcname

func (*Class) GetName

func (c *Class) GetName() string

GetName 获得类名称

func (*Class) GetPath

func (c *Class) GetPath() string

func (*Class) GetPkgName

func (c *Class) GetPkgName() string

func (*Class) GetPkgPath

func (c *Class) GetPkgPath() string

GetPkgPath 获取包的路径

type DelayQueue

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

func NewDelayQueue

func NewDelayQueue() *DelayQueue

func (*DelayQueue) Add

func (dq *DelayQueue) Add(value interface{}, delay time.Time)

func (*DelayQueue) Size

func (dq *DelayQueue) Size() int

func (*DelayQueue) Take

func (dq *DelayQueue) Take() (value interface{})

type LinkedHashMap

type LinkedHashMap[K comparable, T any] struct {
	// contains filtered or unexported fields
}

func NewLinkHashMap

func NewLinkHashMap[K comparable, T any]() *LinkedHashMap[K, T]

func (*LinkedHashMap[K, T]) Contains

func (m *LinkedHashMap[K, T]) Contains(key K) bool

func (*LinkedHashMap[K, T]) Get

func (m *LinkedHashMap[K, T]) Get(k K) (T, bool)

func (*LinkedHashMap[K, T]) Keys

func (m *LinkedHashMap[K, T]) Keys() []K

func (*LinkedHashMap[K, T]) Put

func (m *LinkedHashMap[K, T]) Put(k K, v T)

func (*LinkedHashMap[K, T]) Remove

func (m *LinkedHashMap[K, T]) Remove(k K)

func (*LinkedHashMap[K, T]) RemoveFirst

func (m *LinkedHashMap[K, T]) RemoveFirst() K

func (*LinkedHashMap[K, T]) RemoveLast

func (m *LinkedHashMap[K, T]) RemoveLast() K

func (*LinkedHashMap[K, T]) Size

func (m *LinkedHashMap[K, T]) Size() int

func (*LinkedHashMap[K, T]) Values

func (m *LinkedHashMap[K, T]) Values() []T

type LinkedList

type LinkedList[T comparable] struct {
	// contains filtered or unexported fields
}

func (*LinkedList[T]) AddFirst

func (l *LinkedList[T]) AddFirst(item T)

func (*LinkedList[T]) AddLast

func (l *LinkedList[T]) AddLast(item T)

func (*LinkedList[T]) Contains

func (l *LinkedList[T]) Contains(item T) bool

func (*LinkedList[T]) RemoveFirst

func (l *LinkedList[T]) RemoveFirst() (T, error)

func (*LinkedList[T]) RemoveLast

func (l *LinkedList[T]) RemoveLast() (T, error)

func (*LinkedList[T]) Size

func (l *LinkedList[T]) Size() int

type Method

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

func NewMethod

func NewMethod(cls *Class, v interface{}) *Method

func (*Method) GetArgs

func (m *Method) GetArgs() []reflect.Type

func (*Method) GetClass

func (m *Method) GetClass() *Class

func (*Method) GetName

func (m *Method) GetName() string

func (*Method) GetPath

func (m *Method) GetPath() string

func (*Method) GetPkgName

func (m *Method) GetPkgName() string

func (*Method) GetRets

func (m *Method) GetRets() []reflect.Type

func (*Method) HasArgs

func (m *Method) HasArgs() bool

func (*Method) HasRets

func (m *Method) HasRets() bool

func (*Method) Invoke

func (m *Method) Invoke(args []reflect.Value) []reflect.Value

Invoke 反射调用方法

type ObjectPriorityQueue

type ObjectPriorityQueue[T Ordered] struct {
	Max bool
	// contains filtered or unexported fields
}

func (*ObjectPriorityQueue[T]) Contains

func (h *ObjectPriorityQueue[T]) Contains(e T) bool

func (*ObjectPriorityQueue[T]) Offer

func (h *ObjectPriorityQueue[T]) Offer(e T)

func (*ObjectPriorityQueue[T]) Peek

func (h *ObjectPriorityQueue[T]) Peek() (T, error)

func (*ObjectPriorityQueue[T]) Poll

func (h *ObjectPriorityQueue[T]) Poll() (T, error)

func (*ObjectPriorityQueue[T]) Size

func (h *ObjectPriorityQueue[T]) Size() int

type Ordered

type Ordered interface {
	// String sort and uuid
	String() string
}

type PriorityQueue

type PriorityQueue[T constraints.Ordered] struct {
	Max bool
	// contains filtered or unexported fields
}

func (*PriorityQueue[T]) Contains

func (h *PriorityQueue[T]) Contains(e T) bool

func (*PriorityQueue[T]) Offer

func (h *PriorityQueue[T]) Offer(e T)

func (*PriorityQueue[T]) Peek

func (h *PriorityQueue[T]) Peek() (T, error)

func (*PriorityQueue[T]) Poll

func (h *PriorityQueue[T]) Poll() (T, error)

func (*PriorityQueue[T]) Size

func (h *PriorityQueue[T]) Size() int

type SafeRingQueue

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

func NewSafeRingQueue

func NewSafeRingQueue(cap int) *SafeRingQueue

func (*SafeRingQueue) BlockDequeue

func (q *SafeRingQueue) BlockDequeue() interface{}

func (*SafeRingQueue) BlockEnqueue

func (q *SafeRingQueue) BlockEnqueue(val interface{})

func (*SafeRingQueue) Dequeue

func (q *SafeRingQueue) Dequeue() (interface{}, error)

func (*SafeRingQueue) Enqueue

func (q *SafeRingQueue) Enqueue(val interface{}) error

func (*SafeRingQueue) Peek

func (q *SafeRingQueue) Peek() (interface{}, error)

func (*SafeRingQueue) Size

func (q *SafeRingQueue) Size() int

type Set

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

func (Set[T]) Add

func (s Set[T]) Add(elem T)

func (Set[T]) Clear

func (s Set[T]) Clear()

func (Set[T]) Contains

func (s Set[T]) Contains(elem T) bool

func (Set[T]) Empty

func (s Set[T]) Empty() bool

func (Set[T]) Remove

func (s Set[T]) Remove(elem T) bool

func (Set[T]) Size

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

func (Set[T]) ToSlice

func (s Set[T]) ToSlice() []T

type Time

type Time time.Time

func NewTime

func NewTime(str string) Time

func (*Time) IsZero

func (t *Time) IsZero() bool

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) MarshalXML

func (t *Time) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Time) Scan

func (t *Time) Scan(val interface{}) (err error)

func (Time) String

func (t Time) String() string

func (*Time) Time

func (t *Time) Time() time.Time

func (*Time) UTCString

func (t *Time) UTCString() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

func (*Time) Value

func (t *Time) Value() (driver.Value, error)

type TimeStandard

type TimeStandard time.Time

func NewTimeStandard

func NewTimeStandard(str string) TimeStandard

func (*TimeStandard) IsZero

func (t *TimeStandard) IsZero() bool

func (*TimeStandard) MarshalJSON

func (t *TimeStandard) MarshalJSON() ([]byte, error)

func (*TimeStandard) MarshalXML

func (t *TimeStandard) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*TimeStandard) Scan

func (t *TimeStandard) Scan(val interface{}) (err error)

func (TimeStandard) String

func (t TimeStandard) String() string

func (*TimeStandard) Time

func (t *TimeStandard) Time() time.Time

func (*TimeStandard) UTCString

func (t *TimeStandard) UTCString() string

func (*TimeStandard) UnmarshalJSON

func (t *TimeStandard) UnmarshalJSON(data []byte) (err error)

func (*TimeStandard) Value

func (t *TimeStandard) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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