handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MessageNotFound = Message{Message: "Not found"}

MessageNotFound is a default not found message

View Source
var MessageSuccess = Message{Message: "OK"}

MessageSuccess is a default success message

Functions

This section is empty.

Types

type ManagementHandler

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

ManagementHandler is the handler for the management API

func NewManagementHandler

func NewManagementHandler(e *echo.Echo, repo repository.MockRepository, log *logrus.Logger) *ManagementHandler

NewManagementHandler creates a new ManagementHandler

func (*ManagementHandler) CreateMock

func (h *ManagementHandler) CreateMock(c echo.Context) error

CreateMock creates a new mock

func (*ManagementHandler) DeleteMock

func (h *ManagementHandler) DeleteMock(c echo.Context) error

DeleteMock deletes a mock

func (*ManagementHandler) ExportMocks

func (h *ManagementHandler) ExportMocks(c echo.Context) error

ExportMocks exports all mocks to YAML

func (*ManagementHandler) GetMocks

func (h *ManagementHandler) GetMocks(c echo.Context) error

GetMocks returns all mocks

func (*ManagementHandler) ImportMocks

func (h *ManagementHandler) ImportMocks(c echo.Context) error

ImportMocks imports mocks from YAML

func (*ManagementHandler) RegisterRoutes

func (h *ManagementHandler) RegisterRoutes()

RegisterRoutes registers the routes for the handler

func (*ManagementHandler) UpdateMock

func (h *ManagementHandler) UpdateMock(c echo.Context) error

UpdateMock updates a mock

type Message

type Message struct {
	Message string      `json:"message"`
	Details interface{} `json:"details,omitempty"`
}

Message is a generic message struct for returning JSON messages

type MockHandler

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

MockHandler handles mock requests

func NewMockHandler

func NewMockHandler(e *echo.Echo, repo repository.MockRepository, log *logrus.Logger) *MockHandler

NewMockHandler creates new MockHandler

func (*MockHandler) RegisterRoutes

func (h *MockHandler) RegisterRoutes()

RegisterRoutes registers routes for MockHandler

type PayloadMocks

type PayloadMocks struct {
	Items []*models.Mock `json:"items"`
}

PayloadMocks is a payload for returning mocks

type PingHandler

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

PingHandler is the handler for the /ping route

func NewPingHandler

func NewPingHandler(e *echo.Echo) *PingHandler

NewPingHandler creates a new PingHandler

func (*PingHandler) Ping

func (h *PingHandler) Ping(c echo.Context) error

Ping is the handler to check if the application is running and healthy

func (*PingHandler) RegisterRoutes

func (h *PingHandler) RegisterRoutes()

RegisterRoutes registers the routes for the handler

Jump to

Keyboard shortcuts

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