Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorAction rules.ActionFunc = func(ctx context.Context) (context.Context, error) { return ctx, fmt.Errorf("error occurred") }
View Source
var IdempotencyAction rules.ActionFunc = func(ctx context.Context) (context.Context, error) { customerID := ctx.Value("customer_id") if customerID == nil { return ctx, fmt.Errorf("customer_id not found in context") } ik := fmt.Sprintf("customer_id:%d", ctx.Value("customer_id").(int)) log.Println("identifying customer with key:", ik) return ctx, nil }
Functions ¶
func CreateAction ¶
func CreateAction(actionType string, config ActionConfig) rules.ActionFunc
CreateAction creates an ActionFunc based on the action type
Types ¶
type ActionConfig ¶
type ActionConfig struct {
URL string `json:"url"` // Example config for fetching data
Value string `json:"value"` // Example config for logging
}
ActionConfig defines the structure for action configurations
Click to show internal directories.
Click to hide internal directories.