Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatorInputToMap ¶
func CalculatorInputToMap(v *CalculatorInput) map[string]any
CalculatorInputToMap converts a *CalculatorInput to map[string]any.
This function performs type-safe serialization.
func CalculatorOutputToMap ¶
func CalculatorOutputToMap(v *CalculatorOutput) map[string]any
CalculatorOutputToMap converts a *CalculatorOutput to map[string]any.
This function performs type-safe serialization.
Types ¶
type CalculatorInput ¶
type CalculatorInput struct {
// The operation to perform (add, subtract, multiply, divide)
Operation string `json:"operation"`
// First operand
A float64 `json:"a"`
// Second operand
B float64 `json:"b"`
// Number of decimal places for result
Precision *int `json:"precision,omitempty"`
// When the calculation was requested
Timestamp time.Time `json:"timestamp,omitempty"`
}
CalculatorInput represents the plugin calculatorinput structure.
func CalculatorInputFromMap ¶
func CalculatorInputFromMap(data map[string]any) (*CalculatorInput, error)
CalculatorInputFromMap converts a map[string]any to *CalculatorInput.
This function performs type-safe conversion with validation for required fields.
type CalculatorOutput ¶
type CalculatorOutput struct {
// The calculation result
Result float64 `json:"result"`
// Error message if calculation failed
Error *string `json:"error,omitempty"`
// Time taken to perform the calculation
Duration time.Duration `json:"duration,omitempty"`
}
CalculatorOutput represents the plugin calculatoroutput structure.
func CalculatorOutputFromMap ¶
func CalculatorOutputFromMap(data map[string]any) (*CalculatorOutput, error)
CalculatorOutputFromMap converts a map[string]any to *CalculatorOutput.
This function performs type-safe conversion with validation for required fields.