handlers

package
v0.0.0-...-ce3407c Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusHandler

func StatusHandler(c *gin.Context)

StatusHandler handles the status endpoint

Types

type EventHandler

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

func NewEventHandler

func NewEventHandler(repo *repository.EventRepository, expander *scheduler.Expander) *EventHandler

func (*EventHandler) CreateEvent

func (h *EventHandler) CreateEvent(c *gin.Context)

func (*EventHandler) DeleteEvent

func (h *EventHandler) DeleteEvent(c *gin.Context)

func (*EventHandler) GetEvent

func (h *EventHandler) GetEvent(c *gin.Context)

func (*EventHandler) ListEventsByTags

func (h *EventHandler) ListEventsByTags(c *gin.Context)

func (*EventHandler) UpdateEvent

func (h *EventHandler) UpdateEvent(c *gin.Context)

type HMACInfo

type HMACInfo struct {
	Algorithm              string `json:"algorithm"`
	SignatureHeader        string `json:"signature_header"`
	DefaultSecret          string `json:"default_secret"`
	EventOverrideSupported bool   `json:"event_override_supported"`
}

HMACInfo contains HMAC signing configuration

type JWTInfo

type JWTInfo struct {
	Issuer            string `json:"issuer"`
	Algorithm         string `json:"algorithm"`
	DefaultExpSeconds int    `json:"default_exp_seconds"`
	TokenInfo         struct {
		Sub    string   `json:"sub"`
		Access string   `json:"access"`
		Scope  []string `json:"scope"`
		Exp    int64    `json:"exp"`
	} `json:"token_info"`
}

JWTInfo contains JWT configuration information

type OccurrenceHandler

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

func NewOccurrenceHandler

func NewOccurrenceHandler(eventRepo *repository.EventRepository, occurrenceRepo *repository.OccurrenceRepository) *OccurrenceHandler

func (*OccurrenceHandler) GetOccurrence

func (h *OccurrenceHandler) GetOccurrence(c *gin.Context)

func (*OccurrenceHandler) ListOccurrencesByEvent

func (h *OccurrenceHandler) ListOccurrencesByEvent(c *gin.Context)

func (*OccurrenceHandler) ListOccurrencesByTags

func (h *OccurrenceHandler) ListOccurrencesByTags(c *gin.Context)

type StatusResponse

type StatusResponse struct {
	Status        string   `json:"status"`
	UptimeSeconds int64    `json:"uptime_seconds"`
	Version       string   `json:"version"`
	JWT           JWTInfo  `json:"jwt"`
	HMAC          HMACInfo `json:"hmac"`
}

StatusResponse represents the status endpoint response

type TokenHandler

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

func NewTokenHandler

func NewTokenHandler(tokenService *services.TokenService) *TokenHandler

func (*TokenHandler) AuthMiddleware

func (h *TokenHandler) AuthMiddleware(requiredAccess models.AccessLevel, requiredTags []string) gin.HandlerFunc

AuthMiddleware validates JWT tokens and checks scope/access

func (*TokenHandler) CreateToken

func (h *TokenHandler) CreateToken(c *gin.Context)

CreateToken handles the creation of new JWT tokens

type WebSocketHandler

type WebSocketHandler struct {
	DB *sqlx.DB
	// contains filtered or unexported fields
}

func NewWebSocketHandler

func NewWebSocketHandler(db *sqlx.DB) *WebSocketHandler

func (*WebSocketHandler) DispatchToClient

func (h *WebSocketHandler) DispatchToClient(clientID string, payload []byte) error

DispatchToClient sends the payload to one of the connected clients for the given clientID using round-robin

func (*WebSocketHandler) Handle

func (h *WebSocketHandler) Handle(c *gin.Context)

Jump to

Keyboard shortcuts

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