godskeqing

package module
v0.0.0-...-1222f9e Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: BSD-2-Clause, ISC, MIT Imports: 11 Imported by: 0

README

gods-keqing

一些自己会用到的数据结构,基于gods实现的线程安全版本(添加sync.RWMutex

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentPriorityQueue

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

func NewConcurrentPriorityQueue

func NewConcurrentPriorityQueue(cmp utils.Comparator) *ConcurrentPriorityQueue

func (*ConcurrentPriorityQueue) Dequeue

func (q *ConcurrentPriorityQueue) Dequeue() any

func (*ConcurrentPriorityQueue) Empty

func (q *ConcurrentPriorityQueue) Empty() bool

func (*ConcurrentPriorityQueue) Enqueue

func (q *ConcurrentPriorityQueue) Enqueue(v any)

func (*ConcurrentPriorityQueue) Peek

func (q *ConcurrentPriorityQueue) Peek() any

type ConcurrentQueue

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

func NewConcurrentQueue

func NewConcurrentQueue() *ConcurrentQueue

func (ConcurrentQueue) Dequeue

func (q ConcurrentQueue) Dequeue() any

func (ConcurrentQueue) Empty

func (q ConcurrentQueue) Empty() bool

func (ConcurrentQueue) Enqueue

func (q ConcurrentQueue) Enqueue(v any)

func (ConcurrentQueue) Peek

func (q ConcurrentQueue) Peek() any

type ConcurrentSet

type ConcurrentSet[K comparable] struct {
	// contains filtered or unexported fields
}

func ConcurrentFromSlice

func ConcurrentFromSlice[K comparable](slc []K) ConcurrentSet[K]

func NewConcurrentSet

func NewConcurrentSet[K comparable]() ConcurrentSet[K]

func (*ConcurrentSet[K]) Add

func (set *ConcurrentSet[K]) Add(k K)

func (*ConcurrentSet[K]) AddAll

func (set *ConcurrentSet[K]) AddAll(ks []K)

func (*ConcurrentSet[K]) Contains

func (set *ConcurrentSet[K]) Contains(k K) bool

func (*ConcurrentSet[K]) ContainsAll

func (set *ConcurrentSet[K]) ContainsAll(ks []K) bool

func (*ConcurrentSet[K]) Empty

func (set *ConcurrentSet[K]) Empty() bool

func (*ConcurrentSet[K]) Merge

func (set *ConcurrentSet[K]) Merge(s Set[K])

func (*ConcurrentSet[K]) Remove

func (set *ConcurrentSet[K]) Remove(k K)

func (*ConcurrentSet[K]) ToSlice

func (set *ConcurrentSet[K]) ToSlice() []K

type DirNode

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

type DirTree

type DirTree DirNode

func NewDir

func NewDir(dirName string) *DirTree

func NewDirTree

func NewDirTree() *DirTree

func NewFile

func NewFile(f *SimpleFile) *DirTree

func ReadDirTree

func ReadDirTree(pt string) (*DirTree, error)

ReadDirTree

func (*DirTree) AddDir

func (t *DirTree) AddDir(d *DirTree, path ...string) bool

func (*DirTree) AddFile

func (t *DirTree) AddFile(f *DirTree, path ...string) bool

func (DirTree) IsDir

func (t DirTree) IsDir() bool

func (DirTree) IsRoot

func (t DirTree) IsRoot() bool

func (*DirTree) Navigate

func (t *DirTree) Navigate(path ...string) *DirTree

func (DirTree) String

func (t DirTree) String() string

type Queue

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

func NewQueue

func NewQueue() *Queue

func (*Queue) Dequeue

func (q *Queue) Dequeue() any

func (*Queue) Empty

func (q *Queue) Empty() bool

func (*Queue) Enqueue

func (q *Queue) Enqueue(v any)

func (*Queue) Peek

func (q *Queue) Peek() any

type Set

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

func FromSlice

func FromSlice[K comparable](slc []K) Set[K]

func NewSet

func NewSet[K comparable]() Set[K]

func (Set[K]) Add

func (set Set[K]) Add(k K)

func (Set[K]) AddAll

func (set Set[K]) AddAll(ks []K)

func (Set[K]) Contains

func (set Set[K]) Contains(k K) bool

func (Set[K]) ContainsAll

func (set Set[K]) ContainsAll(ks []K) bool

func (Set[K]) Empty

func (set Set[K]) Empty() bool

func (Set[K]) Merge

func (set Set[K]) Merge(s Set[K])

func (Set[K]) Remove

func (set Set[K]) Remove(k K)

func (Set[K]) String

func (set Set[K]) String() string

func (Set[K]) ToSlice

func (set Set[K]) ToSlice() []K

type SimpleFile

type SimpleFile struct {
	DirName    string
	FileName   string
	Size       uint64
	User       string
	Group      string
	Access     string
	ModifyTime string
	CreateTime string
}

func (SimpleFile) IsDir

func (f SimpleFile) IsDir() bool

type Stack

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

func NewStack

func NewStack() Stack

func (Stack) Empty

func (s Stack) Empty() bool

func (Stack) Peek

func (s Stack) Peek() any

func (Stack) Push

func (s Stack) Push(e any)

func (Stack) Remove

func (s Stack) Remove() any

Jump to

Keyboard shortcuts

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