handler

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupRateLimitingRoutes

func SetupRateLimitingRoutes(router *gin.Engine, rateLimitHandler *RateLimitHandler)

SetupRateLimitingRoutes sets up all rate limiting related routes

Types

type BreadCrumb struct {
	Name string
	Path string
}

BreadCrumb represents a navigation breadcrumb

type DocPage

type DocPage struct {
	Title       string
	Content     string
	Path        string
	NavTree     []dto.DocItem
	BreadCrumbs []BreadCrumb
}

DocPage represents a documentation page with content

type DocsHandler

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

DocsHandler handles documentation page rendering

func NewDocsHandler

func NewDocsHandler(docsPath string) *DocsHandler

NewDocsHandler creates a new docs handler

func (*DocsHandler) GetDocsList

func (h *DocsHandler) GetDocsList(c *gin.Context)

GetDocsList returns the full documentation tree structure

func (*DocsHandler) GetDocsPage

func (h *DocsHandler) GetDocsPage(c *gin.Context)

GetDocsPage retrieves and renders a documentation page

type OAuthHandler added in v0.0.7

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

OAuthHandler handles OAuth authentication endpoints

func NewOAuthHandler added in v0.0.7

func NewOAuthHandler(oauthService *service.OAuthService) *OAuthHandler

NewOAuthHandler creates a new OAuth handler

func (*OAuthHandler) Callback added in v0.0.7

func (h *OAuthHandler) Callback(c *gin.Context)

Callback handles OAuth provider callback

func (*OAuthHandler) GetProviders added in v0.0.7

func (h *OAuthHandler) GetProviders(c *gin.Context)

GetProviders returns list of configured OAuth providers

func (*OAuthHandler) Login added in v0.0.7

func (h *OAuthHandler) Login(c *gin.Context)

Login initiates OAuth login flow

type PerformanceHandler

type PerformanceHandler interface {
	PerformanceReader
	PerformanceWriter
}

func NewPerformanceHandler

func NewPerformanceHandler(configProvider *config.AdminConfigProvider) PerformanceHandler

NewPerformanceHandler creates a new PerformanceHandler with its dependencies.

type PerformanceReader

type PerformanceReader interface {
	GetHomePage(c *gin.Context)
	GetAPIAnalyticsPage(c *gin.Context)
	GetEndpointDetailsPage(c *gin.Context)
	GetRouteMetadataManagementPage(c *gin.Context)
	GetRoleManagementPage(c *gin.Context)
	GetRoleDetailsPage(c *gin.Context)
	GetPolicyManagementPage(c *gin.Context)
	GetAuditLogsPage(c *gin.Context)
	GetFeaturesDocumentationPage(c *gin.Context)
	GetLoginPage(c *gin.Context)
	GetUsersForRole(c *gin.Context)
}

type PerformanceWriter

type PerformanceWriter interface {
	SaveRouteMetadata(c *gin.Context)
	ImportRouteMetadata(c *gin.Context)
	DeleteRouteMetadata(c *gin.Context)
	LoginJSON(c *gin.Context)
	Logout(c *gin.Context)
	CreateRole(c *gin.Context)
	UpdateRole(c *gin.Context)
	AssignRoleToUser(c *gin.Context)
	RemoveRoleFromUser(c *gin.Context)
	DeleteRole(c *gin.Context)
}

type RateLimitHandler

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

RateLimitHandler handles rate limit UI requests

func NewRateLimitHandler

func NewRateLimitHandler(manager *RateLimitManager) *RateLimitHandler

NewRateLimitHandler creates a new rate limit handler

func (*RateLimitHandler) ExportRateLimitStats

func (h *RateLimitHandler) ExportRateLimitStats(c *gin.Context)

ExportRateLimitStats exports statistics as CSV

func (*RateLimitHandler) GetEndpointLimits

func (h *RateLimitHandler) GetEndpointLimits(c *gin.Context)

GetEndpointLimits returns all endpoint limits

func (*RateLimitHandler) GetIPStats

func (h *RateLimitHandler) GetIPStats(c *gin.Context)

GetIPStats returns statistics for a specific IP

func (*RateLimitHandler) GetRateLimitPage

func (h *RateLimitHandler) GetRateLimitPage(c *gin.Context)

GetRateLimitPage returns the rate limiting UI page

func (*RateLimitHandler) GetRateLimitStats

func (h *RateLimitHandler) GetRateLimitStats(c *gin.Context)

GetRateLimitStats returns JSON statistics

func (*RateLimitHandler) GetRateLimitingPage

func (h *RateLimitHandler) GetRateLimitingPage(c *gin.Context)

GetRateLimitingPage returns the rate limiting management page

func (*RateLimitHandler) ResetAllLimits

func (h *RateLimitHandler) ResetAllLimits(c *gin.Context)

ResetAllLimits resets all rate limits

func (*RateLimitHandler) ResetIPLimit

func (h *RateLimitHandler) ResetIPLimit(c *gin.Context)

ResetIPLimit resets the rate limit for an IP

func (*RateLimitHandler) SearchRateLimitStats

func (h *RateLimitHandler) SearchRateLimitStats(c *gin.Context)

SearchRateLimitStats searches rate limit statistics

func (*RateLimitHandler) SetEndpointLimit

func (h *RateLimitHandler) SetEndpointLimit(c *gin.Context)

SetEndpointLimit sets a rate limit for an endpoint

func (*RateLimitHandler) UpdateGlobalLimit

func (h *RateLimitHandler) UpdateGlobalLimit(c *gin.Context)

UpdateGlobalLimit updates the global rate limit

type RateLimitManager

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

RateLimitManager manages rate limiting statistics and configuration

func NewRateLimitManager

func NewRateLimitManager(globalRate rate.Limit, globalBurst int) *RateLimitManager

NewRateLimitManager creates a new rate limit manager

func (*RateLimitManager) GetAllEndpointLimits

func (m *RateLimitManager) GetAllEndpointLimits() map[string]map[string]interface{}

GetAllEndpointLimits returns all endpoint limits

func (*RateLimitManager) GetAllStats

func (m *RateLimitManager) GetAllStats() []*RateLimitStats

GetAllStats returns statistics for all IPs

func (*RateLimitManager) GetEndpointLimit

func (m *RateLimitManager) GetEndpointLimit(endpoint string) (rate.Limit, int)

GetEndpointLimit gets the rate limit for an endpoint

func (*RateLimitManager) GetGlobalLimit

func (m *RateLimitManager) GetGlobalLimit() (rate.Limit, int)

GetGlobalLimit returns the current global rate limit

func (*RateLimitManager) GetStats

func (m *RateLimitManager) GetStats(ip string) *RateLimitStats

GetStats returns statistics for an IP

func (*RateLimitManager) ResetIP

func (m *RateLimitManager) ResetIP(ip string) error

ResetIP resets statistics for an IP

func (*RateLimitManager) SetEndpointLimit

func (m *RateLimitManager) SetEndpointLimit(endpoint string, limit rate.Limit, burst int) error

SetEndpointLimit sets a custom rate limit for an endpoint

func (*RateLimitManager) UpdateGlobalLimit

func (m *RateLimitManager) UpdateGlobalLimit(limit rate.Limit, burst int) error

UpdateGlobalLimit updates the global rate limit

func (*RateLimitManager) UpdateStats

func (m *RateLimitManager) UpdateStats(ip string, allowed bool)

UpdateStats updates statistics for an IP

type RateLimitStats

type RateLimitStats struct {
	IP              string
	RequestCount    int64
	ResetTime       int64
	LimitPerSecond  float64
	BurstSize       int
	CurrentAllowed  int64
	LastRequestTime time.Time
	IsBlocked       bool
}

RateLimitStats holds statistics for a rate limiter

Jump to

Keyboard shortcuts

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