util

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicLock

type AtomicLock int32

func (*AtomicLock) AcquireLock

func (l *AtomicLock) AcquireLock() bool

func (*AtomicLock) IsLocked

func (l *AtomicLock) IsLocked() bool

func (*AtomicLock) Unlock

func (l *AtomicLock) Unlock()

type Queue added in v0.15.0

type Queue interface {
	Pop() (interface{}, error)
	Push(...interface{})
	Len() uint
}

func NewThreadSafeQueue added in v0.15.0

func NewThreadSafeQueue() Queue

func NewThreadUnsafeQueue added in v0.15.0

func NewThreadUnsafeQueue() Queue

type Snowflake

type Snowflake = snowflake.Snowflake

func GetSnowflake

func GetSnowflake(v interface{}) (Snowflake, error)

GetSnowflake see snowflake.GetSnowflake

func ParseSnowflakeString

func ParseSnowflakeString(v string) Snowflake

ParseSnowflakeString see snowflake.ParseSnowflakeString

type Ticket

type Ticket int
const (
	NoTicket Ticket = -1
)

type TicketQueue

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

func (*TicketQueue) Delete

func (q *TicketQueue) Delete(ticket Ticket)

func (*TicketQueue) NewTicket

func (q *TicketQueue) NewTicket() (ticket Ticket)

func (*TicketQueue) Next

func (q *TicketQueue) Next(ticket Ticket, cb func() bool) bool

Jump to

Keyboard shortcuts

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