Documentation
¶
Index ¶
- Variables
- type ManagementHandler
- func (h *ManagementHandler) CreateMock(c echo.Context) error
- func (h *ManagementHandler) DeleteMock(c echo.Context) error
- func (h *ManagementHandler) ExportMocks(c echo.Context) error
- func (h *ManagementHandler) GetMocks(c echo.Context) error
- func (h *ManagementHandler) ImportMocks(c echo.Context) error
- func (h *ManagementHandler) RegisterRoutes()
- func (h *ManagementHandler) UpdateMock(c echo.Context) error
- type Message
- type MockHandler
- type PayloadMocks
- type PingHandler
Constants ¶
This section is empty.
Variables ¶
var MessageNotFound = Message{Message: "Not found"}
MessageNotFound is a default not found message
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 ¶
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