handlers

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTestSuite

func ExecuteTestSuite(c *gin.Context)

ExecuteTestSuite godoc @Summary Execute a test suite @Description Execute a Voiceflow test suite from request data and return execution ID @Tags tests @Accept json @Produce json @Param request body TestExecutionRequest true "Test execution request with embedded suite and tests" @Success 202 {object} TestExecutionResponse @Failure 400 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /api/v1/tests/execute [post]

func GetSystemInfo

func GetSystemInfo(c *gin.Context)

GetSystemInfo godoc @Summary Get system information @Description Get information about the API server system @Tags system @Accept json @Produce json @Success 200 {object} SystemInfoResponse @Router /api/v1/system/info [get]

func GetTestStatus

func GetTestStatus(c *gin.Context)

GetTestStatus godoc @Summary Get test execution status @Description Get the status and logs of a test execution @Tags tests @Accept json @Produce json @Param id path string true "Test execution ID" @Success 200 {object} TestStatusResponse @Failure 404 {object} ErrorResponse @Router /api/v1/tests/status/{id} [get]

func HealthCheck

func HealthCheck(c *gin.Context)

HealthCheck godoc @Summary Health check endpoint @Description Check if the API server is running @Tags system @Accept json @Produce json @Success 200 {object} map[string]string @Router /health [get]

Types

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error" example:"Invalid request"`
	Message string `json:"message,omitempty" example:"Detailed error message"`

} // @name ErrorResponse

ErrorResponse represents an error response

type SystemInfoResponse

type SystemInfoResponse struct {
	Version   string `json:"version" example:"1.0.0"`
	GoVersion string `json:"go_version" example:"go1.20.0"`
	OS        string `json:"os" example:"linux"`
	Arch      string `json:"arch" example:"amd64"`

} // @name SystemInfoResponse

SystemInfoResponse represents the system information

type TestExecution

type TestExecution struct {
	ID          string
	Status      string
	StartedAt   time.Time
	CompletedAt *time.Time
	Logs        []string
	Error       string
	// contains filtered or unexported fields
}

TestExecution represents a running test execution

func (*TestExecution) AddLog

func (te *TestExecution) AddLog(log string)

Thread-safe methods for TestExecution

func (*TestExecution) GetStatus

func (te *TestExecution) GetStatus() TestStatusResponse

func (*TestExecution) SetError

func (te *TestExecution) SetError(error string)

func (*TestExecution) SetStatus

func (te *TestExecution) SetStatus(status string)

type TestExecutionRequest

type TestExecutionRequest struct {
	Suite              TestSuiteRequest `json:"suite" binding:"required"`
	ApiKey             string           `json:"api_key,omitempty"`             // Optional token to override global.VoiceflowAPIKey
	VoiceflowSubdomain string           `json:"voiceflow_subdomain,omitempty"` // Optional subdomain to override global.VoiceflowSubdomain

} // @name TestExecutionRequest

TestExecutionRequest represents the request body for test execution Now accepts the suite configuration directly instead of a file path

type TestExecutionResponse

type TestExecutionResponse struct {
	ID        string    `json:"id" example:"123e4567-e89b-12d3-a456-426614174000"`
	Status    string    `json:"status" example:"running"`
	StartedAt time.Time `json:"started_at" example:"2023-01-01T00:00:00Z"`
	Logs      []string  `json:"logs,omitempty"`
	Error     string    `json:"error,omitempty"`

} // @name TestExecutionResponse

TestExecutionResponse represents the response for test execution

type TestRequest

type TestRequest struct {
	ID   string     `json:"id" binding:"required" example:"test_1"`
	Test tests.Test `json:"test" binding:"required"`

} // @name TestRequest

TestRequest represents a test configuration for HTTP requests Contains the test definition directly instead of a file reference

type TestStatusResponse

type TestStatusResponse struct {
	ID          string     `json:"id" example:"123e4567-e89b-12d3-a456-426614174000"`
	Status      string     `json:"status" example:"completed"`
	StartedAt   time.Time  `json:"started_at" example:"2023-01-01T00:00:00Z"`
	CompletedAt *time.Time `json:"completed_at,omitempty" example:"2023-01-01T00:05:00Z"`
	Logs        []string   `json:"logs"`
	Error       string     `json:"error,omitempty"`

} // @name TestStatusResponse

TestStatusResponse represents the response for test status

type TestSuiteRequest

type TestSuiteRequest struct {
	Name            string        `json:"name" binding:"required" example:"Example Suite"`
	Description     string        `json:"description" example:"Suite used as an example"`
	EnvironmentName string        `json:"environment_name" binding:"required" example:"production"`
	Tests           []TestRequest `json:"tests" binding:"required,dive"`

} // @name TestSuiteRequest

TestSuiteRequest represents a test suite configuration for HTTP requests

Jump to

Keyboard shortcuts

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