utils

package
v0.0.0-...-5be1c45 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

@Time : 2020-04-10 10:39 @Author : Lukebryan

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRedis

func InitRedis(RedisConfigs []RedisConfig) ([]*redis.Client, error)

Types

type Counter

type Counter struct {
	Count int
	// contains filtered or unexported fields
}

func NewCounter

func NewCounter() *Counter

func (*Counter) GetCount

func (c *Counter) GetCount() int

func (*Counter) ReStart

func (c *Counter) ReStart()

func (*Counter) Start

func (c *Counter) Start()

func (*Counter) Stop

func (c *Counter) Stop()

type Item

type Item interface{}

type Queue

type Queue struct {
	Items []Item
}

队列结构体

func NewQueue

func NewQueue() *Queue

func (*Queue) Dequeue

func (q *Queue) Dequeue() *Item

出队

func (*Queue) Enqueue

func (q *Queue) Enqueue(data Item)

入队

func (*Queue) IsEmpty

func (q *Queue) IsEmpty() bool

队列是否为空

func (*Queue) New

func (q *Queue) New() *Queue

新建

func (*Queue) Size

func (q *Queue) Size() int

队列长度

func (*Queue) ToEmpty

func (q *Queue) ToEmpty()

队列置为空

type RedisConfig

type RedisConfig struct {
	Host     string
	Port     string
	Password string
}

Jump to

Keyboard shortcuts

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