controllers

package
v0.0.0-...-c0e7709 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitUsageSubscriber

func InitUsageSubscriber()

InitUsageSubscriber inits the api usage subscriber function

func RateProcess

func RateProcess(ch chan models.RateRequest)

RateProcess process the rate update requests. If the rate exceeds the max limit, it will send message to block the api token. For reset type requests it resets the api current usage to 0

func Usage

func Usage(ch <-chan *redis.Message, desc string, t models.Type)

Usage go routine will handle the api usage subscription messages desc is the usage description of the go routine t is the type of requests that needed to be catered

Types

type App

type App struct {
	*revel.Controller
}

App is the main controller of the application

func (App) Index

func (c App) Index() revel.Result

Index serves the index page of the application

func (App) Reset

func (c App) Reset(token string) revel.Result

Reset resets the usage of an api token

func (App) Usage

func (c App) Usage(token string) revel.Result

Usage returns the usage of an api

Jump to

Keyboard shortcuts

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