server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OCPDownloadRequest

type OCPDownloadRequest struct {
	Version   string   `json:"version"`
	Artifacts []string `json:"artifacts"` // list of artifact names to download
}

OCPDownloadRequest is the request body for POST /api/ocp/download.

type OCPDownloadStatus

type OCPDownloadStatus struct {
	Name   string `json:"name"`
	Status string `json:"status"` // "pending", "downloading", "done", "error"
	Error  string `json:"error,omitempty"`
	Path   string `json:"path,omitempty"`
}

OCPDownloadStatus tracks the status of each artifact download.

type ProviderStatusJSON

type ProviderStatusJSON struct {
	Name        string    `json:"name"`
	Enabled     bool      `json:"enabled"`
	FileCount   int       `json:"file_count"`
	TotalSize   int64     `json:"total_size"`
	LastSync    time.Time `json:"last_sync"`
	LastStatus  string    `json:"last_status"`
	FailedFiles int       `json:"failed_files"`
}

ProviderStatusJSON is the JSON representation of a provider status.

type RegistryPushRequest

type RegistryPushRequest struct {
	SourceProvider string `json:"source_provider"`
	TargetProvider string `json:"target_provider"`
	DryRun         bool   `json:"dry_run"`
}

RegistryPushRequest is the expected request body for POST /api/registry/push.

type ResolveFailuresRequest

type ResolveFailuresRequest struct {
	Provider string  `json:"provider"`
	IDs      []int64 `json:"ids"`
	All      bool    `json:"all"`
}

ResolveFailuresRequest is the expected request body for POST /api/sync/failures/resolve.

type RetryRequestBody

type RetryRequestBody struct {
	Provider string `json:"provider"`
}

RetryRequestBody is the expected request body for POST /api/sync/retry.

type ScanRequestBody

type ScanRequestBody struct {
	Provider string `json:"provider"`
}

ScanRequestBody is the expected request body for POST /api/scan.

type Server

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

Server represents the HTTP server for the airgap web UI.

func NewServer

func NewServer(
	eng *engine.SyncManager,
	reg *provider.Registry,
	st *store.Store,
	cfg *config.Config,
	logger *slog.Logger,
) *Server

NewServer creates a new Server instance.

func (*Server) SetVersion added in v0.4.0

func (s *Server) SetVersion(v string)

SetVersion sets the version string displayed in the UI.

func (*Server) Shutdown

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

Shutdown gracefully shuts down the HTTP server.

func (*Server) Start

func (s *Server) Start(listenAddr string) error

Start starts the HTTP server on the given listen address.

type SyncRequestBody

type SyncRequestBody struct {
	Provider   string `json:"provider"`
	DryRun     bool   `json:"dry_run"`
	Force      bool   `json:"force"`
	MaxWorkers int    `json:"max_workers"`
}

SyncRequestBody is the expected request body for POST /api/sync.

type SyncResponseBody

type SyncResponseBody struct {
	Provider         string    `json:"provider"`
	Success          bool      `json:"success"`
	Message          string    `json:"message"`
	Downloaded       int       `json:"downloaded,omitempty"`
	Deleted          int       `json:"deleted,omitempty"`
	Skipped          int       `json:"skipped,omitempty"`
	Failed           int       `json:"failed,omitempty"`
	BytesTransferred int64     `json:"bytes_transferred,omitempty"`
	StartTime        time.Time `json:"start_time,omitempty"`
	EndTime          time.Time `json:"end_time,omitempty"`
}

SyncResponseBody is the response from POST /api/sync.

type ValidateRequestBody

type ValidateRequestBody struct {
	Provider string `json:"provider"`
}

ValidateRequestBody is the expected request body for POST /api/validate.

Jump to

Keyboard shortcuts

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