api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package api provides the REST API server for the accessibility audit service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEngine

type AuditEngine interface {
	RunAudit(ctx context.Context, cfg *config.Config) (*audit.AuditResult, error)
}

AuditEngine is the interface for running audits.

type AuditJob

type AuditJob struct {
	ID        string             `json:"id"`
	Status    string             `json:"status"` // pending, running, completed, failed
	Config    *config.Config     `json:"config"`
	Result    *audit.AuditResult `json:"result,omitempty"`
	Error     string             `json:"error,omitempty"`
	StartTime time.Time          `json:"startTime"`
	EndTime   time.Time          `json:"endTime,omitempty"`
	Progress  int                `json:"progress"` // 0-100
}

AuditJob represents a running or completed audit job.

type CreateAuditRequest

type CreateAuditRequest struct {
	URL     string                 `json:"url"`
	Config  map[string]interface{} `json:"config,omitempty"`
	Journey *config.JourneyRef     `json:"journey,omitempty"`
}

CreateAuditRequest is the request body for creating an audit.

type CreateAuditResponse

type CreateAuditResponse struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

CreateAuditResponse is the response for creating an audit.

type Server

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

Server is the REST API server.

func NewServer

func NewServer(engine AuditEngine, logger *slog.Logger, port int) *Server

NewServer creates a new API server.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start starts the API server.

Jump to

Keyboard shortcuts

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