api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriftStore

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

DriftStore manages drift detection results

func GetGlobalDriftStore

func GetGlobalDriftStore() *DriftStore

GetGlobalDriftStore returns the global drift store instance

func (*DriftStore) CleanupOld

func (ds *DriftStore) CleanupOld(maxAge time.Duration) int

CleanupOld removes drift results older than the specified duration

func (*DriftStore) Clear

func (ds *DriftStore) Clear()

Clear removes all drift results

func (*DriftStore) Delete

func (ds *DriftStore) Delete(id string)

Delete removes a drift result

func (*DriftStore) Get

func (ds *DriftStore) Get(id string) (*detector.DriftResult, bool)

Get retrieves a drift result by ID

func (*DriftStore) List

func (ds *DriftStore) List() []*detector.DriftResult

List returns all stored drift results

func (*DriftStore) Store

func (ds *DriftStore) Store(id string, result *detector.DriftResult)

Store stores a drift result

type Server

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

Server represents the API server

func NewServer

func NewServer(config ServerConfig) *Server

NewServer creates a new API server

func (*Server) HandleDiscovery

func (s *Server) HandleDiscovery(w http.ResponseWriter, r *http.Request)

API handlers - minimal stubs

func (*Server) HandleDiscoveryStatus

func (s *Server) HandleDiscoveryStatus(w http.ResponseWriter, r *http.Request)

func (*Server) HandleDriftDetection

func (s *Server) HandleDriftDetection(w http.ResponseWriter, r *http.Request)

func (*Server) HandleDriftResults

func (s *Server) HandleDriftResults(w http.ResponseWriter, r *http.Request)

func (*Server) HandleGetResource

func (s *Server) HandleGetResource(w http.ResponseWriter, r *http.Request)

func (*Server) HandleListResources

func (s *Server) HandleListResources(w http.ResponseWriter, r *http.Request)

func (*Server) HandleListStates

func (s *Server) HandleListStates(w http.ResponseWriter, r *http.Request)

func (*Server) HandleMetrics

func (s *Server) HandleMetrics(w http.ResponseWriter, r *http.Request)

func (*Server) HandleRemediation

func (s *Server) HandleRemediation(w http.ResponseWriter, r *http.Request)

func (*Server) HandleRemediationStatus

func (s *Server) HandleRemediationStatus(w http.ResponseWriter, r *http.Request)

func (*Server) HandleStateAnalysis

func (s *Server) HandleStateAnalysis(w http.ResponseWriter, r *http.Request)

func (*Server) HandleStatePull

func (s *Server) HandleStatePull(w http.ResponseWriter, r *http.Request)

func (*Server) HandleStatePush

func (s *Server) HandleStatePush(w http.ResponseWriter, r *http.Request)

func (*Server) HandleWebSocket

func (s *Server) HandleWebSocket(w http.ResponseWriter, r *http.Request)

func (*Server) RegisterHealthChecks

func (s *Server) RegisterHealthChecks()

RegisterHealthChecks registers health check endpoints

func (*Server) RegisterRoute

func (s *Server) RegisterRoute(method, path string, handler http.HandlerFunc)

RegisterRoute registers a route with the server

func (*Server) Router

func (s *Server) Router() http.Handler

Router returns the HTTP handler

func (*Server) Start

func (s *Server) Start() error

Start starts the HTTP server

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop stops the HTTP server (graceful shutdown)

type ServerConfig

type ServerConfig struct {
	Host       string
	Port       string
	EnableAuth bool
	JWTSecret  string
	TLSCert    string
	TLSKey     string
}

ServerConfig holds server configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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