Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Commit = "unknown" BuildDate = "unknown" )
Version information (set via ldflags)
Functions ¶
func LoginRateLimitMiddleware ¶ added in v1.3.1
func LoginRateLimitMiddleware(limiter *RateLimiter) gin.HandlerFunc
LoginRateLimitMiddleware returns a Gin middleware that rate limits login attempts Limit: 5 attempts per IP per minute
Types ¶
type RateLimiter ¶ added in v1.3.1
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter implements a simple in-memory rate limiter based on IP address Uses a sliding window approach with automatic cleanup
func NewRateLimiter ¶ added in v1.3.1
func NewRateLimiter(limit int, window time.Duration) *RateLimiter
NewRateLimiter creates a new rate limiter limit: maximum number of attempts allowed window: time window for the limit (e.g., 1 minute)
func (*RateLimiter) Allow ¶ added in v1.3.1
func (rl *RateLimiter) Allow(ip string) bool
Allow checks if a request from the given IP should be allowed Returns true if within rate limit, false if exceeded
type ReleaseAsset ¶ added in v1.3.3
type ReleaseAsset struct {
Name string `json:"name"`
DownloadURL string `json:"download_url"`
Size int64 `json:"size"`
}
ReleaseAsset represents a downloadable release asset
type ReleasesResponse ¶ added in v1.3.3
type ReleasesResponse struct {
TagName string `json:"tag_name"`
PublishedAt string `json:"published_at"`
Assets []ReleaseAsset `json:"assets"`
}
ReleasesResponse represents the latest release info with assets
type SystemInfoResponse ¶ added in v1.3.0
type SystemInfoResponse struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
GoVersion string `json:"go_version"`
OS string `json:"os"`
Arch string `json:"arch"`
}
SystemInfoResponse represents system information
type UpdateCheckResponse ¶ added in v1.3.0
type UpdateCheckResponse struct {
HasUpdate bool `json:"has_update"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version,omitempty"`
ReleaseNotes string `json:"release_notes,omitempty"`
ReleaseURL string `json:"release_url,omitempty"`
PublishedAt string `json:"published_at,omitempty"`
}
UpdateCheckResponse represents the update check result