api

package
v0.0.0-...-f96b470 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT.

Index

Constants

View Source
const (
	ApiKeyAuthScopes = "ApiKeyAuth.Scopes"
)

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type CreateProjectJSONRequestBody

type CreateProjectJSONRequestBody = Project

CreateProjectJSONRequestBody defines body for CreateProject for application/json ContentType.

type CreateScenarioJSONRequestBody

type CreateScenarioJSONRequestBody = ScenarioCreateRequest

CreateScenarioJSONRequestBody defines body for CreateScenario for application/json ContentType.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type ErrMsg

type ErrMsg struct {
	Message string `json:"message"`
}

ErrMsg defines model for ErrMsg.

type ListProjectsParams

type ListProjectsParams struct {
	// Limit The number of projects to return
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset The number of projects to skip
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}

ListProjectsParams defines parameters for ListProjects.

type ListRunsForProjectParams

type ListRunsForProjectParams struct {
	// Limit The number of runs to return
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset The number of runs to skip
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}

ListRunsForProjectParams defines parameters for ListRunsForProject.

type ListScenariosForProjectParams

type ListScenariosForProjectParams struct {
	// Limit The number of scenarios to return
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Offset The number of scenarios to skip
	Offset *int `form:"offset,omitempty" json:"offset,omitempty"`
}

ListScenariosForProjectParams defines parameters for ListScenariosForProject.

type Project

type Project struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
}

Project defines model for Project.

type ProjectArray

type ProjectArray = []Project

ProjectArray defines model for ProjectArray.

type ProjectRunOutput

type ProjectRunOutput struct {
	ID                 uuid.UUID             `json:"id"`
	ProjectID          uuid.UUID             `json:"project_id"`
	ScenarioRunDetails []ScenarioRunDetails  `json:"scenario_run_details"`
	State              ProjectRunOutputState `json:"state"`
	Success            bool                  `json:"success"`
}

ProjectRunOutput defines model for ProjectRunOutput.

type ProjectRunOutputArray

type ProjectRunOutputArray = []ProjectRunOutput

ProjectRunOutputArray defines model for ProjectRunOutputArray.

type ProjectRunOutputState

type ProjectRunOutputState string

ProjectRunOutputState defines model for ProjectRunOutput.State.

const (
	Cancelled ProjectRunOutputState = "cancelled"
	Completed ProjectRunOutputState = "completed"
	Failure   ProjectRunOutputState = "failure"
	Pending   ProjectRunOutputState = "pending"
	Running   ProjectRunOutputState = "running"
)

Defines values for ProjectRunOutputState.

type ProjectRunRequest

type ProjectRunRequest struct {
	ProjectID   *uuid.UUID `json:"project_id,omitempty"`
	ProjectName *string    `json:"project_name,omitempty"`
}

ProjectRunRequest defines model for ProjectRunRequest.

type RunProjectJSONRequestBody

type RunProjectJSONRequestBody = ProjectRunRequest

RunProjectJSONRequestBody defines body for RunProject for application/json ContentType.

type Scenario

type Scenario struct {
	ID        uuid.UUID        `json:"id"`
	Name      string           `json:"name"`
	ProjectID uuid.UUID        `json:"project_id"`
	Spec      string           `json:"spec"`
	SpecType  ScenarioSpecType `json:"spec_type"`
}

Scenario defines model for Scenario.

type ScenarioArray

type ScenarioArray = []Scenario

ScenarioArray defines model for ScenarioArray.

type ScenarioCreateRequest

type ScenarioCreateRequest struct {
	Name string `json:"name"`

	// Spec A base64 encoded string of the spec
	Spec     string `json:"spec"`
	SpecType string `json:"spec_type"`
}

ScenarioCreateRequest defines model for ScenarioCreateRequest.

type ScenarioRunDetails

type ScenarioRunDetails struct {
	Assertions   int              `json:"assertions"`
	DurationInMs int              `json:"duration_in_ms"`
	Name         string           `json:"name"`
	Steps        []StepRunDetails `json:"steps"`
	Success      bool             `json:"success"`
}

ScenarioRunDetails defines model for ScenarioRunDetails.

type ScenarioSpecType

type ScenarioSpecType string

ScenarioSpecType defines model for Scenario.SpecType.

const (
	Yaml ScenarioSpecType = "yaml"
)

Defines values for ScenarioSpecType.

type ServerInterface

type ServerInterface interface {

	// (GET /v1/projects)
	ListProjects(ctx echo.Context, params ListProjectsParams) error

	// (POST /v1/projects)
	CreateProject(ctx echo.Context) error

	// (POST /v1/projects/run)
	RunProject(ctx echo.Context) error

	// (GET /v1/projects/{id}/runs)
	ListRunsForProject(ctx echo.Context, id uuid.UUID, params ListRunsForProjectParams) error

	// (GET /v1/projects/{project_id}/scenarios)
	ListScenariosForProject(ctx echo.Context, projectId uuid.UUID, params ListScenariosForProjectParams) error

	// (POST /v1/projects/{project_id}/scenarios)
	CreateScenario(ctx echo.Context, projectId uuid.UUID) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateProject

func (w *ServerInterfaceWrapper) CreateProject(ctx echo.Context) error

CreateProject converts echo context to params.

func (*ServerInterfaceWrapper) CreateScenario

func (w *ServerInterfaceWrapper) CreateScenario(ctx echo.Context) error

CreateScenario converts echo context to params.

func (*ServerInterfaceWrapper) ListProjects

func (w *ServerInterfaceWrapper) ListProjects(ctx echo.Context) error

ListProjects converts echo context to params.

func (*ServerInterfaceWrapper) ListRunsForProject

func (w *ServerInterfaceWrapper) ListRunsForProject(ctx echo.Context) error

ListRunsForProject converts echo context to params.

func (*ServerInterfaceWrapper) ListScenariosForProject

func (w *ServerInterfaceWrapper) ListScenariosForProject(ctx echo.Context) error

ListScenariosForProject converts echo context to params.

func (*ServerInterfaceWrapper) RunProject

func (w *ServerInterfaceWrapper) RunProject(ctx echo.Context) error

RunProject converts echo context to params.

type StepRunDetails

type StepRunDetails struct {
	Assertions          int    `json:"assertions"`
	DurationInMs        int    `json:"duration_in_ms"`
	Name                string `json:"name"`
	RequestDurationInMs int    `json:"request_duration_in_ms"`
	Retries             int    `json:"retries"`
	Success             bool   `json:"success"`
	URL                 string `json:"url"`
}

StepRunDetails defines model for StepRunDetails.

Jump to

Keyboard shortcuts

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