quota

package
v0.0.0-...-cda7898 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package quota is used to handle all quota-service related operations. Handling is implemented with a HTTP router returned from NewRouter and setup its routes using Setup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Router

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

Router is a structure that handles quota related requests.

func NewRouter

func NewRouter(
	quotaConn *grpcPoolTypes.ConnPool,
	logger *logrus.Logger,
) *Router

NewRouter creates a new Router, and initializes clients of the quota Service with the given connection. If logger is non-nil then it will be set as-is, otherwise logger would default to logrus.New().

func (*Router) GetOwnerQuota

func (r *Router) GetOwnerQuota(c *gin.Context)

GetOwnerQuota is the request handler for GET /user/quota

func (*Router) GetQuotaByID

func (r *Router) GetQuotaByID(c *gin.Context)

GetQuotaByID is the request handler for GET /users/:id/quota

func (*Router) Setup

func (r *Router) Setup(rg *gin.RouterGroup)

Setup sets up r and intializes its routes under rg.

Jump to

Keyboard shortcuts

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