util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStringIn

func IsStringIn(i string, arr []string) bool

func MergeFunc

func MergeFunc(fns ...interface{}) interface{}

使用的时候需要各种形式一致 方法内未检验

func StringsToInts

func StringsToInts(arr []string) []int

func UnixMill

func UnixMill() int64

Types

type BufferPool

type BufferPool struct {
	sync.Pool
}

func NewBufferPool

func NewBufferPool() *BufferPool

新建一个buf pool

func (*BufferPool) Get

func (bp *BufferPool) Get() *bytes.Buffer

获取

func (*BufferPool) Put

func (bp *BufferPool) Put(b *bytes.Buffer)

放回

type IntSet

type IntSet map[int64]struct{}

func NewIntSet

func NewIntSet() IntSet

func (IntSet) Add

func (set IntSet) Add(v int64)

func (IntSet) Clone

func (set IntSet) Clone() IntSet

func (IntSet) IsMember

func (set IntSet) IsMember(v int64) bool

func (IntSet) Remove

func (set IntSet) Remove(v int64)

type Reset

type Reset interface {
	Reset()
}

type TypePools

type TypePools struct {
	New func(t reflect.Type) interface{}
	// contains filtered or unexported fields
}

func NewTypePools

func NewTypePools() *TypePools

func (*TypePools) Get

func (p *TypePools) Get(t reflect.Type) interface{}

func (*TypePools) Init

func (p *TypePools) Init(t reflect.Type)

func (*TypePools) Put

func (p *TypePools) Put(t reflect.Type, x interface{})

Jump to

Keyboard shortcuts

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