api

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 Server

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

func NewServer

func NewServer(db *storage.DB, mon *monitor.Service, distFS fs.FS) *Server

func (*Server) Run

func (s *Server) Run(addr string) error

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

Jump to

Keyboard shortcuts

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