handler

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteServiceResponse added in v0.1.11

func WriteServiceResponse(response http.ResponseWriter, status int, value any, err error)

Types

type AgentMetricsState

type AgentMetricsState struct {
	OrganizationID string               `json:"organization_id"`
	AgentType      string               `json:"agent_type"`
	AgentID        string               `json:"agent_id"`
	Status         string               `json:"status"`
	LastSeenAt     string               `json:"last_seen_at"`
	Metrics        agent.MetricsPayload `json:"metrics"`
}

type AgentStateRegistry

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

func NewAgentStateRegistry

func NewAgentStateRegistry() *AgentStateRegistry

func (*AgentStateRegistry) IsCurrent

func (registry *AgentStateRegistry) IsCurrent(organizationID string, agentType string, agentID string, generation int64) bool

func (*AgentStateRegistry) Latest

func (registry *AgentStateRegistry) Latest(organizationID string, agentType string, agentID string) (AgentMetricsState, bool)

func (*AgentStateRegistry) LatestByOrganizationAndType

func (registry *AgentStateRegistry) LatestByOrganizationAndType(organizationID string, agentType string) []AgentMetricsState

func (*AgentStateRegistry) MarkConnected

func (registry *AgentStateRegistry) MarkConnected(organizationID string, agentType string, agentID string) int64

func (*AgentStateRegistry) MarkDisconnected

func (registry *AgentStateRegistry) MarkDisconnected(organizationID string, agentType string, agentID string, generation int64) bool

func (*AgentStateRegistry) UpdateMetrics

func (registry *AgentStateRegistry) UpdateMetrics(organizationID string, agentType string, agentID string, metrics agent.MetricsPayload)

func (*AgentStateRegistry) UpdateMetricsForConnection

func (registry *AgentStateRegistry) UpdateMetricsForConnection(organizationID string, agentType string, agentID string, generation int64, metrics agent.MetricsPayload) bool

type ControlRouteExtension added in v0.1.11

type ControlRouteExtension interface {
	RegisterControlRoutes(registry ControlRouteRegistry)
}

type ControlRouteRegistry added in v0.1.11

type ControlRouteRegistry interface {
	HandleInternal(pattern string, handler InternalRouteHandler)
	ControlService() *service.ControlService
	Edition() edition.Provider
}

type ControlServer

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

func NewControlServer

func NewControlServer(options ControlServerOptions) *ControlServer

func (*ControlServer) ServeHTTP

func (server *ControlServer) ServeHTTP(response http.ResponseWriter, request *http.Request)

type ControlServerOptions

type ControlServerOptions struct {
	TokenVerifier           auth.InternalTokenVerifier
	WebUserVerifier         auth.WebUserTokenVerifier
	RepositoryStore         repo.UnitOfWork
	ControlService          *service.ControlService
	InternalTokenTTL        time.Duration
	AppName                 string
	ControlPlaneURL         string
	AgentReleaseVersion     string
	AgentTokenSigningSecret []byte
	AgentStateRegistry      *AgentStateRegistry
	Edition                 edition.Provider
	RouteExtensions         []ControlRouteExtension
}

type InternalRouteHandler added in v0.1.11

type InternalRouteHandler func(http.ResponseWriter, *http.Request, service.InternalIdentity)

Jump to

Keyboard shortcuts

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