handlers

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: 11 Imported by: 0

Documentation

Overview

Package handlers implements the handlers for the API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerWrapper

type HandlerWrapper struct {
	*ProjectHandler
	*ScenarioHandler
	*RunHandler
}

HandlerWrapper wraps all handlers.

func NewHandlerWrapper

func NewHandlerWrapper(
	serviceWrapper service.Wrapper,
	opts ...Opts,
) *HandlerWrapper

NewHandlerWrapper initialises all handlers.

type Options

type Options struct {
	Logger *slog.Logger
}

Options represents the options for the handlers.

type Opts

type Opts func(*Options)

Opts represents a function that modifies the options.

func WithLogger

func WithLogger(logger *slog.Logger) Opts

WithLogger sets the logger.

type ProjectHandler

type ProjectHandler struct {
	// contains filtered or unexported fields
}

ProjectHandler handles project requests.

func (*ProjectHandler) CreateProject

func (h *ProjectHandler) CreateProject(ctx echo.Context) error

CreateProject creates a new project.

func (*ProjectHandler) ListProjects

func (h *ProjectHandler) ListProjects(ctx echo.Context, params api.ListProjectsParams) error

ListProjects lists all projects.

type RunHandler

type RunHandler struct {
	// contains filtered or unexported fields
}

RunHandler handles run requests.

func (*RunHandler) ListRunsForProject

func (h *RunHandler) ListRunsForProject(ctx echo.Context, id uuid.UUID, params api.ListRunsForProjectParams) error

ListRunsForProject returns runs for a given project.

func (*RunHandler) RunProject

func (h *RunHandler) RunProject(ctx echo.Context) error

RunProject runs all scenarios for a given project.

type ScenarioHandler

type ScenarioHandler struct {
	// contains filtered or unexported fields
}

ScenarioHandler handles scenario requests.

func (*ScenarioHandler) CreateScenario

func (h *ScenarioHandler) CreateScenario(ctx echo.Context, projectID uuid.UUID) error

CreateScenario create a scenario for a project.

func (*ScenarioHandler) ListScenariosForProject

func (h *ScenarioHandler) ListScenariosForProject(ctx echo.Context, projectId uuid.UUID, params api.ListScenariosForProjectParams) error

ListScenariosForProject lists all scenarios for a project.

Jump to

Keyboard shortcuts

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