base_server

package
v0.0.0-...-af65acb Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RedisConfDo

func RedisConfDo(commandName string, args ...interface{}) (interface{}, error)

func RedisConfPipline

func RedisConfPipline(pip ...func(c redis.Conn)) error

Types

type FlowCountService

type FlowCountService struct {
	AppID       string        //应用ID
	Interval    time.Duration //采集频率
	TotalCount  int64         //当前总共请求数
	QPS         int64         //QPS
	Unix        int64         //上次unix时间戳
	TickerCount int64         //当前流量
}

func NewFlowCountService

func NewFlowCountService(appID string, interval time.Duration) (*FlowCountService, error)

func (*FlowCountService) Increase

func (o *FlowCountService) Increase()

原子增加

type RedisFlowCountService

type RedisFlowCountService struct {
	AppID       string
	Interval    time.Duration
	QPS         int64
	Unix        int64
	TickerCount int64
	TotalCount  int64
}

func NewRedisFlowCountService

func NewRedisFlowCountService(appID string, interval time.Duration) (*RedisFlowCountService, error)

func (*RedisFlowCountService) Increase

func (o *RedisFlowCountService) Increase()

原子增加

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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