Documentation
¶
Index ¶
- Constants
- type Component
- func (c *Component) GetCheckConfig() *checks.CEL
- func (c *Component) GetCheckContext(ctx context.Context) (map[string]any, error)
- func (c *Component) GetHealth(ctx context.Context) *ph.HealthCheckResponse
- func (c *Component) GetType() string
- func (c *Component) SetChecks(exprs []checks.Expression) error
- func (c *Component) Setup() error
- type Option
Constants ¶
View Source
const ProviderType = "mock"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶ added in v0.6.0
type Component struct {
provider.Base
provider.BaseWithChecks
Health ph.Status `mapstructure:"health" default:"HEALTHY"`
Sleep time.Duration `mapstructure:"sleep" default:"1ns"`
}
func New ¶ added in v0.7.0
New creates a mock component with the given name and options. Defaults to HEALTHY status if not specified via WithHealth.
func Unhealthy ¶ added in v0.6.0
Unhealthy creates an unhealthy mock with the given name and options.
func (*Component) GetCheckConfig ¶ added in v0.6.0
func (*Component) GetCheckContext ¶ added in v0.6.0
func (*Component) GetHealth ¶ added in v0.6.0
func (c *Component) GetHealth(ctx context.Context) *ph.HealthCheckResponse
type Option ¶ added in v0.7.0
type Option func(*Component)
Option configures a mock Component.
func WithAlways ¶ added in v0.8.0
WithAlways marks the mock to always execute even after fail-fast.
func WithHealth ¶ added in v0.7.0
WithHealth sets the health status for the mock.
Click to show internal directories.
Click to hide internal directories.