usage

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limit

type Limit struct {

	// Count represents the maximum count of usage number.
	Count int64

	// UserId represents the Limit user association. If empty, the Limit is a group-level limit.
	UserId string

	// Expires represents the user-specific limit expiration deadline.
	Expires time.Time
}

Limit represents the usage limit.

type Subject

type Subject int
const (
	SubjectUndefined Subject = iota
	SubjectSubscriptions
	SubjectPublishEvents
)

func (Subject) String

func (s Subject) String() string

type Usage

type Usage struct {

	// Count represents the usage count since the last reset time (if any).
	Count int64

	// CountTotal represents the total usage count since the time in the Since field.
	CountTotal int64

	// Since represents the time when usage started for the 1st time. Together with CountTotal it may be used to
	// estimate the average usage rate.
	Since time.Time
}

Jump to

Keyboard shortcuts

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