api

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidReportFormat = errors.New("Invalid Report Format")
)

Functions

This section is empty.

Types

type ReportNotificationDTO

type ReportNotificationDTO struct {
	Subject string `json:"subject"`
	Body    string `json:"body"`
	Format  string `json:"format"`
}

ReportNotificationDTO represents the response DTO for the Get Report's Notification endpoint.

type ReportsAPI

type ReportsAPI struct {
	ReportsService *ReportsService
	// contains filtered or unexported fields
}

ReportsAPI represents an API to interact with reports.

func NewReportsAPI

func NewReportsAPI(reportsService *ReportsService) *ReportsAPI

NewReportsAPI builds a new reports API.

func (*ReportsAPI) Start

func (a *ReportsAPI) Start(port int) error

Start starts ReportsAPI to listen on specified port.

type ReportsService

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

ReportsService represents the service layer for the reports API.

func NewReportsService

func NewReportsService(log *log.Logger, notifier notify.Notifier,
	repositories map[model.ReportType]storage.ReportsRepository) *ReportsService

NewReportsService builds a new Reports API Service.

func (*ReportsService) GetReportNotification

func (s *ReportsService) GetReportNotification(c echo.Context) error

GetReportNotification returns the report's notification data for the specified type and id.

func (*ReportsService) HealthCheck

func (s *ReportsService) HealthCheck(c echo.Context) error

HealthCheck is the service handler for healthcheck queries.

func (*ReportsService) SendReport

func (s *ReportsService) SendReport(c echo.Context) error

SendReport sends the report notification for the specified report type and id.

type SendReportReqDTO

type SendReportReqDTO struct {
	Recipients []string `json:"recipients"`
}

SendReportReqDTO represents the DTO for the Send Report endpoint payload.

Jump to

Keyboard shortcuts

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