Documentation
¶
Index ¶
Constants ¶
View Source
const ( StateClosed = "closed" StateHalfOpen = "half-open" StateOpen = "open" )
Circuit breaker states as string constants.
Variables ¶
This section is empty.
Functions ¶
func CreatePlugin ¶
Types ¶
type CircuitBreaker ¶
type CircuitBreaker interface { // Record a successful operation RecordSuccess() // Record a failed operation RecordFailure() bool // Check if the circuit is open IsOpen() bool // Reset the circuit breaker Reset() // Get the current state GetState() string // Get the current failure count GetFailureCount() int }
CircuitBreaker defines the interface for a circuit breaker.
func NewCircuitBreakerWithOptions ¶
func NewCircuitBreakerWithOptions(failureThreshold int, resetTimeout time.Duration) CircuitBreaker
NewCircuitBreakerWithOptions creates a new circuit breaker with custom settings.
type CircuitBreakerManager ¶
type CircuitBreakerManager interface { // Get a circuit breaker for a function GetCircuitBreaker(key string) CircuitBreaker // Remove a circuit breaker RemoveCircuitBreaker(key string) // Reset all circuit breakers Reset() // Get state of a circuit breaker GetCircuitBreakerState(key string) string // Get all circuit breakers as a map GetAllCircuitBreakers() map[string]CircuitBreaker }
CircuitBreakerManager manages circuit breakers for functions.
func NewCircuitBreakerManagerWithOptions ¶
func NewCircuitBreakerManagerWithOptions(settings CircuitBreakerSettings) CircuitBreakerManager
NewCircuitBreakerManagerWithOptions creates a new circuit breaker manager with custom settings.
type CircuitBreakerSettings ¶
CircuitBreakerSettings holds configuration for circuit breakers.
type FunctionID ¶
FunctionID represents a unique function identifier.
type PluginManager ¶
type PluginManager interface { // Plugin operations GetPlugin(key string) (*extism.Plugin, bool) StorePlugin(key string, plugin *extism.Plugin, digest string, config map[string]string) RemovePlugin(key string) bool // Plugin state management IsPluginLoaded(key string) bool WasPreviouslyLoaded(key string) (bool, map[string]string) HasConfigChanged(key string, newConfig map[string]string) bool HasDigestChanged(key string, newDigest string) bool GetPluginDigest(key string) (string, bool) GetPluginConfig(key string) (map[string]string, bool) // Function state control StopFunction(key string) bool IsFunctionStopped(key string) bool ClearStoppedStatus(key string) // Lifecycle management StartCleanup(ctx context.Context) Shutdown() // Information provider ListLoadedFunctions() []string GetLoadedFunctionCount() int GetPreviouslyLoadedFunctions() map[string]bool GetStoppedFunctions() map[string]bool GetLogStore() *logging.FunctionLogStore }
PluginManager defines all plugin management capabilities
func NewPluginManager ¶
func NewPluginManager(logger logging.Logger, options PluginManagerSettings) PluginManager
NewPluginManager creates a new plugin manager with the specified settings.
Click to show internal directories.
Click to hide internal directories.