controller

package
v0.0.0-...-33b7491 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RateLimitCount  = "2"
	RateLimitExpiry = 60 * time.Second
	PingProcessTime = 5 * time.Second
)

Variables

This section is empty.

Functions

func Count

func Count(c *gin.Context, redisClient *redis.Client)

function Count - Method: GET - Description: Provides an approximate count of users who have called the /ping API, leveraging HyperLogLog. - Response 200 OK: ```json

{
  "estimatedCount": 150
}

func Login

func Login(c *gin.Context, redisClient *redis.Client)

func Ping

func Ping(c *gin.Context, redisClient *redis.Client)

func Signup

func Signup(c *gin.Context)

func TopUsersCallingAPI

func TopUsersCallingAPI(c *gin.Context, redisClient *redis.Client)

function Top. - Method: GET - Description: Returns the top 10 users based on the frequency of API calls from Redis. - Responses 200 OK: ```json

{
	"topUsersCallingAPIAllTime": [
		"CallingPingAPI userID:1 called 1 times",
		"CallingPingAPI userID:3 called 4 times"
	]
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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