Skip to content

Commit

Permalink
feat(项目): 定义Collection和Queue
Browse files Browse the repository at this point in the history
  • Loading branch information
storezhang committed Nov 6, 2024
1 parent f0207f9 commit 467c2d4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions collection.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package collection

// Collection 集合
type Collection interface {
// Size 大小
Size() int
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/goexl/wanip
module github.com/goexl/collection

go 1.19
go 1.23
12 changes: 12 additions & 0 deletions queue.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package collection

// Queue 队列
type Queue[T any] interface {
Collection

// Enqueue 入队
Enqueue(T, ...T)

// Dequeue 出队
Dequeue() []T
}

0 comments on commit 467c2d4

Please sign in to comment.