v1

package
v0.0.0-...-052ce05 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Package v1 provides the API for the webserver.

Index

Constants

View Source
const (
	ActionAll    = "ARGUS_ALL"
	ActionSkip   = "ARGUS_SKIP"
	ActionFailed = "ARGUS_FAILED"
)

Action codes.

Variables

This section is empty.

Functions

func ConstantTimeCompare

func ConstantTimeCompare(x, y [32]byte) bool

ConstantTimeCompare returns whether the slices x and y have equal contents. The time taken depends on the length of the slices, and remains independent of the contents.

func ServeWs

func ServeWs(hub *Hub, w http.ResponseWriter, r *http.Request)

ServeWs handles websocket requests from the peer.

Types

type API

type API struct {
	Config      *config.Config
	BaseRouter  *mux.Router
	Router      *mux.Router
	RoutePrefix string
}

API holds the configuration and routing information.

func NewAPI

func NewAPI(cfg *config.Config) *API

NewAPI will create a new API with the provided config.

func (*API) DisableRoutes

func (api *API) DisableRoutes()

DisableRoutes disables HTTP API routes marked as disabled in the config.

func (*API) SetupRoutesAPI

func (api *API) SetupRoutesAPI()

SetupRoutesAPI will set up the HTTP API routes.

func (*API) SetupRoutesFavicon

func (api *API) SetupRoutesFavicon()

SetupRoutesFavicon adds any favicon route overrides.

func (*API) SetupRoutesNodeJS

func (api *API) SetupRoutesNodeJS()

SetupRoutesNodeJS will set up the HTTP routes to the Node.js files.

type AnnounceMSG

type AnnounceMSG struct {
	Type      string `json:"type"`
	ServiceID string `json:"service_id"`
}

AnnounceMSG is minimal JSON to validate the incoming message.

type Client

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

Client connects the websocket and the hub.

type CountsResponse

type CountsResponse struct {
	ServiceCount            int             `json:"service_count"`
	ServiceCountActive      int             `json:"service_count_active"`
	ServiceCountInactive    int             `json:"service_count_inactive"`
	UpdatesCurrentAvailable int             `json:"updates_available"`
	UpdatesCurrentSkipped   int             `json:"updates_skipped"`
	UpdateDetails           []UpdateDetails `json:"update_details,omitempty"`
}

type Hub

type Hub struct {

	// Inbound messages from the clients.
	Broadcast chan []byte
	// contains filtered or unexported fields
}

Hub maintains the set of active clients and broadcasts messages to those clients.

func NewHub

func NewHub() *Hub

NewHub will create a new Hub.

func (*Hub) Run

func (h *Hub) Run()

Run will start the WebSocket Hub.

type RunActionsPayload

type RunActionsPayload struct {
	Target string `json:"target"`
}

RunActionsPayload holds the target actions to run for a Service.

type ServiceOrderAPI

type ServiceOrderAPI struct {
	Order []string `json:"order"`
}

ServiceOrderAPI is the API response for the service order.

type UpdateDetails

type UpdateDetails struct {
	ServiceName     string `json:"service_name"`
	DeployedVersion string `json:"deployed_version"`
	LatestVersion   string `json:"latest_version"`
	LastChecked     string `json:"last_checked"`
	AutoApprove     bool   `json:"auto_approve"`
	Approved        bool   `json:"approved"`
	Skipped         bool   `json:"skipped"`
}

Jump to

Keyboard shortcuts

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