reqlimit

package
v0.0.0-...-d55f1c7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChannelModelRequest

func GetChannelModelRequest(ctx context.Context, channel, model string) (int64, int64)

func GetChannelModelTokensRequest

func GetChannelModelTokensRequest(ctx context.Context, channel, model string) (int64, int64)

func GetGroupModelRequest

func GetGroupModelRequest(ctx context.Context, group, model string) (int64, int64)

func GetGroupModelTokennameRequest

func GetGroupModelTokennameRequest(
	ctx context.Context,
	group, model, tokenname string,
) (int64, int64)

func GetGroupModelTokennameTokensRequest

func GetGroupModelTokennameTokensRequest(
	ctx context.Context,
	group, model, tokenname string,
) (int64, int64)

func GetGroupModelTokensRequest

func GetGroupModelTokensRequest(ctx context.Context, group, model string) (int64, int64)

func PushChannelModelRequest

func PushChannelModelRequest(ctx context.Context, channel, model string) (int64, int64, int64)

func PushChannelModelTokensRequest

func PushChannelModelTokensRequest(
	ctx context.Context,
	channel, model string,
	tokens int64,
) (int64, int64, int64)

func PushGroupModelRequest

func PushGroupModelRequest(
	ctx context.Context,
	group, model string,
	overed int64,
) (int64, int64, int64)

func PushGroupModelTokennameRequest

func PushGroupModelTokennameRequest(
	ctx context.Context,
	group, model, tokenname string,
) (int64, int64, int64)

func PushGroupModelTokennameTokensRequest

func PushGroupModelTokennameTokensRequest(
	ctx context.Context,
	group, model, tokenname string,
	tokens int64,
) (int64, int64, int64)

func PushGroupModelTokensRequest

func PushGroupModelTokensRequest(
	ctx context.Context,
	group, model string,
	maxTokens, tokens int64,
) (int64, int64, int64)

Types

type InMemoryRecord

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

func NewInMemoryRecord

func NewInMemoryRecord() *InMemoryRecord

func (*InMemoryRecord) GetRequest

func (m *InMemoryRecord) GetRequest(
	duration time.Duration,
	keys ...string,
) (totalCount, secondCount int64)

func (*InMemoryRecord) PushRequest

func (m *InMemoryRecord) PushRequest(
	overed int64,
	duration time.Duration,
	n int64,
	keys ...string,
) (normalCount, overCount, secondCount int64)

Jump to

Keyboard shortcuts

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