api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigHandler added in v1.1.0

func ConfigHandler() http.HandlerFunc

ConfigHandler returns a configuration handler

func DiscoverHandler added in v1.1.0

func DiscoverHandler() http.HandlerFunc

DiscoverHandler returns a discovery handler

func DriftHandler added in v1.1.0

func DriftHandler() http.HandlerFunc

DriftHandler returns a drift detection handler

func HealthHandler added in v1.1.0

func HealthHandler() http.HandlerFunc

HealthHandler returns a health check handler

func ProvidersHandler added in v1.1.0

func ProvidersHandler() http.HandlerFunc

ProvidersHandler returns a providers handler

func RemediationHandler added in v1.1.0

func RemediationHandler() http.HandlerFunc

RemediationHandler returns a remediation handler

func ResourcesHandler added in v1.1.0

func ResourcesHandler() http.HandlerFunc

ResourcesHandler returns a resources handler

func StateHandler added in v1.1.0

func StateHandler() http.HandlerFunc

StateHandler returns a state management handler

Types

type Config added in v1.1.0

type Config struct {
	Host             string        `json:"host"`
	Port             int           `json:"port"`
	ReadTimeout      time.Duration `json:"read_timeout"`
	WriteTimeout     time.Duration `json:"write_timeout"`
	IdleTimeout      time.Duration `json:"idle_timeout"`
	MaxHeaderBytes   int           `json:"max_header_bytes"`
	CORSEnabled      bool          `json:"cors_enabled"`
	AuthEnabled      bool          `json:"auth_enabled"`
	RateLimitEnabled bool          `json:"rate_limit_enabled"`
	RateLimitRPS     int           `json:"rate_limit_rps"`
	LoggingEnabled   bool          `json:"logging_enabled"`
}

Config represents server configuration

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 Router added in v1.1.0

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

Router represents the HTTP router

func (*Router) DELETE added in v1.1.0

func (r *Router) DELETE(path string, handler http.HandlerFunc)

DELETE registers a DELETE route

func (*Router) GET added in v1.1.0

func (r *Router) GET(path string, handler http.HandlerFunc)

GET registers a GET route

func (*Router) POST added in v1.1.0

func (r *Router) POST(path string, handler http.HandlerFunc)

POST registers a POST route

func (*Router) PUT added in v1.1.0

func (r *Router) PUT(path string, handler http.HandlerFunc)

PUT registers a PUT route

func (*Router) ServeHTTP added in v1.1.0

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler for Router

type Server

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

Server represents the API server

func NewAPIServer added in v1.1.0

func NewAPIServer(address string) *Server

NewAPIServer creates a new API server with default configuration

func NewServer

func NewServer(config *Config, services *Services) *Server

NewServer creates a new API server

func (*Server) ServeHTTP added in v1.1.0

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

ServeHTTP implements http.Handler

func (*Server) Start

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

Start starts the API server

func (*Server) Stop

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

Stop stops the API server

type Services added in v1.1.0

Services represents all available services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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