v1

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package v1 provides version 1 API handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler holds v1 API dependencies

func NewHandler

func NewHandler(srv *api.Server) *Handler

NewHandler creates a new v1 API handler

func (*Handler) HandleRefresh

func (h *Handler) HandleRefresh(w http.ResponseWriter, r *http.Request)

HandleRefresh implements POST /api/v1/refresh This endpoint triggers a manual refresh of the playlist and EPG data Requires authentication via X-API-Token header

func (*Handler) HandleStatus

func (h *Handler) HandleStatus(w http.ResponseWriter, r *http.Request)

HandleStatus implements GET /api/v1/status This endpoint returns the current status of the xg2g service Supports optional ?check_receiver=true query parameter for receiver health check

type ReceiverStatus added in v1.7.2

type ReceiverStatus struct {
	Reachable    bool   `json:"reachable"`
	ResponseTime int64  `json:"responseTimeMs,omitempty"` // Response time in milliseconds
	Error        string `json:"error,omitempty"`          // Error message if unreachable
}

ReceiverStatus provides receiver connectivity information

type RefreshResponse

type RefreshResponse struct {
	Version  string    `json:"version"`
	LastRun  time.Time `json:"lastRun"`
	Channels int       `json:"channels"`
}

RefreshResponse defines the v1 refresh response contract

type StatusResponse

type StatusResponse struct {
	Status   string          `json:"status"`
	Version  string          `json:"version"`
	LastRun  time.Time       `json:"lastRun"`
	Channels int             `json:"channels"`
	Receiver *ReceiverStatus `json:"receiver,omitempty"` // Optional receiver health check
}

StatusResponse defines the v1 status contract This structure is STABLE and must not change in backwards-incompatible ways

Jump to

Keyboard shortcuts

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