systemversion

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CanManage

func CanManage(root bool, roles []string, enforce func(...interface{}) (bool, error)) bool

CanManage checks the single update-management capability. Role names have no special meaning; only trusted Root context or an explicit policy grants it.

func ProvideService

func ProvideService(ctx context.Context, rdb *redis.Client) (*versionstatus.Service, func(), error)

ProvideService constructs an unstarted service and registers its cleanup with Wire. The Redis client belongs to the application, not this module.

Types

type SystemVersion

type SystemVersion struct {
	Service *versionstatus.Service
	RBAC    *rbac.RBAC
}

func (*SystemVersion) Check

func (a *SystemVersion) Check(c *gin.Context)

Check godoc @Tags SystemVersion @Summary Check for stable version updates @Description Requires update-management permission. Disabled and cooldown requests do not contact sources; they return success=false with the current Updates in data. @Security ApiKeyAuth @Produce json @Success 200 {object} util.ResponseResult{data=versionstatus.Updates} @Failure 401 {object} util.ResponseResult @Failure 403 {object} util.ResponseResult @Failure 409 {object} util.ResponseResult{data=versionstatus.Updates} "update_check_disabled" @Failure 429 {object} util.ResponseResult{data=versionstatus.Updates} "update_check_cooldown" @Header 429 {integer} Retry-After "Seconds until manual checks are permitted" @Failure 500 {object} util.ResponseResult @Router /api/v1/system/updates/check [post]

func (*SystemVersion) CurrentVersion

func (a *SystemVersion) CurrentVersion(c *gin.Context)

CurrentVersion godoc @Tags SystemVersion @Summary Current local version and aggregated Gateway builds @Description Requires login, but not update-management permission. Contains no update targets or node identities. @Security ApiKeyAuth @Produce json @Success 200 {object} util.ResponseResult{data=versionstatus.Summary} @Failure 401 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/current/version [get]

func (*SystemVersion) Init

func (a *SystemVersion) Init(ctx context.Context) error

func (*SystemVersion) RegisterV1Routers

func (a *SystemVersion) RegisterV1Routers(ctx context.Context, v1 *gin.RouterGroup) error

func (*SystemVersion) Release

func (a *SystemVersion) Release(ctx context.Context) error

func (*SystemVersion) Report

func (a *SystemVersion) Report(c *gin.Context)

Report godoc @Tags SystemVersion @Summary Receive a Gateway version report @Description Separate deployment-token boundary; no user JWT. Requires a configured GATEWAY_SYNC_TOKEN, an exact X-Sync-Token match and a valid report in the configured namespace. Reports expire after three minutes. @Accept json @Produce json @Param X-Sync-Token header string true "Deployment synchronization token" @Param node body versionregistry.Node true "Gateway report (maximum 4096 bytes)" @Success 200 {object} util.ResponseResult @Failure 400 {object} util.ResponseResult @Failure 401 {object} util.ResponseResult @Failure 413 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/gateway/version [post]

func (*SystemVersion) Updates

func (a *SystemVersion) Updates(c *gin.Context)

Updates godoc @Tags SystemVersion @Summary Read cached update results @Description Requires the POST /api/v1/system/updates/check capability. Does not contact update sources. @Security ApiKeyAuth @Produce json @Success 200 {object} util.ResponseResult{data=versionstatus.Updates} @Failure 401 {object} util.ResponseResult @Failure 403 {object} util.ResponseResult @Failure 500 {object} util.ResponseResult @Router /api/v1/system/updates [get]

Jump to

Keyboard shortcuts

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