tools

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoElement = errors.New("no element in queue")
	QueueFull = errors.New("queue full")
)

Functions

func IsEffectiveDir added in v0.4.17

func IsEffectiveDir(path string) bool

func IsNilObject

func IsNilObject(object interface{}) bool

IsNilObject 判断是否空对象

func IsNotNil

func IsNotNil(object interface{}) bool

IsNotNil 判断是否nil

func IsRegularFile added in v0.4.17

func IsRegularFile(name string) bool

IsRegularFile 是否普通文档

func JsonFileUnmarshalHelper added in v0.4.17

func JsonFileUnmarshalHelper(file string, desc interface{}) (err error)

JsonFileUnmarshalHelper 打开文件并且序列化到结构体, 方便关闭文件

func ListFileInDirWithSuffix added in v0.4.17

func ListFileInDirWithSuffix(root string, suffix string) ([]string, error)

func ParseIp added in v0.4.4

func ParseIp(addrWithPort string) (string, error)

Types

type Queue added in v0.4.29

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

Queue 工具库,循环队列 TODO 使用模板重构

func (*Queue) Capacity added in v0.4.29

func (q *Queue) Capacity() int

func (*Queue) Empty added in v0.4.29

func (q *Queue) Empty() bool

func (*Queue) Full added in v0.4.29

func (q *Queue) Full() bool

func (*Queue) Init added in v0.4.29

func (q *Queue) Init(capacity int)

func (*Queue) Pop added in v0.4.29

func (q *Queue) Pop() (uint32, error)

func (*Queue) Push added in v0.4.29

func (q *Queue) Push(element uint32) error

func (*Queue) Size added in v0.4.29

func (q *Queue) Size() int

func (*Queue) Top added in v0.4.29

func (q *Queue) Top() (uint32, error)

func (*Queue) UnInit added in v0.4.29

func (q *Queue) UnInit()

Jump to

Keyboard shortcuts

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