httpapi

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(operations Operations, options Options) (http.Handler, error)

NewHandler constructs the complete generated REST handler.

func RequestID

func RequestID(ctx context.Context) string

RequestID returns the constrained request identifier from ctx.

Types

type BearerAuth

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

BearerAuth authenticates one static token using fixed-size digests.

func NewBearerAuth

func NewBearerAuth(token string) (*BearerAuth, error)

NewBearerAuth prepares static bearer authentication.

func (*BearerAuth) Wrap

func (a *BearerAuth) Wrap(next http.Handler) http.Handler

Wrap rejects missing, duplicate, malformed, and incorrect credentials before the downstream handler reads a request body.

func (*BearerAuth) WrapWithLogger

func (a *BearerAuth) WrapWithLogger(
	next http.Handler, logger *slog.Logger, transport string,
) http.Handler

WrapWithLogger authenticates like Wrap and logs only a safe rejection reason.

type Capabilities

type Capabilities = generated.Capabilities

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type CapabilitiesAPIVersion

type CapabilitiesAPIVersion = generated.CapabilitiesAPIVersion

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type CapabilitiesUploadFormats

type CapabilitiesUploadFormats = generated.CapabilitiesUploadFormats

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type Client

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

Client is the typed, non-retrying Airplan REST client foundation.

func NewClient

func NewClient(
	baseURL string,
	token string,
	httpClient *http.Client,
) (*Client, error)

NewClient constructs a typed client for one Airplan server URL.

func (*Client) Capabilities

func (c *Client) Capabilities(ctx context.Context) (Capabilities, error)

Capabilities returns safe compatibility information.

func (*Client) DeleteUpload

func (c *Client) DeleteUpload(
	ctx context.Context,
	request TargetRequest,
) (DeleteResult, error)

DeleteUpload permanently deletes one marker-managed upload.

func (*Client) ExecutePurge

func (c *Client) ExecutePurge(
	ctx context.Context,
	request PurgeRequest,
) (PurgeResult, error)

ExecutePurge permanently deletes explicit reviewed upload IDs.

func (*Client) GetUpload

func (c *Client) GetUpload(
	ctx context.Context,
	request GetUploadRequest,
) (Download, error)

GetUpload opens one streaming marker-declared object response. The caller must close Download.Body.

func (*Client) Health

func (c *Client) Health(ctx context.Context) (Health, error)

Health calls the unauthenticated process liveness endpoint.

func (*Client) InspectUpload

func (c *Client) InspectUpload(
	ctx context.Context,
	request TargetRequest,
) (UploadInspection, error)

InspectUpload validates and describes one marker-managed upload.

func (*Client) ListManifestUploads

func (c *Client) ListManifestUploads(ctx context.Context) (ManifestList, error)

ListManifestUploads lists scoped server manifest history.

func (*Client) ListStorageUploads

func (c *Client) ListStorageUploads(ctx context.Context) (StorageList, error)

ListStorageUploads lists direct storage candidates.

func (*Client) OpenAPI

func (c *Client) OpenAPI(ctx context.Context) ([]byte, error)

OpenAPI returns the exact schema served by the remote process.

func (*Client) PreviewPurge

func (c *Client) PreviewPurge(
	ctx context.Context,
	request PurgePreviewRequest,
) (PurgePreview, error)

PreviewPurge returns explicit candidates without deleting them.

func (*Client) SyncManifest

func (c *Client) SyncManifest(
	ctx context.Context,
	request SyncRequest,
) (SyncResult, error)

SyncManifest plans or applies storage-to-manifest reconciliation.

func (*Client) UploadCollection

func (c *Client) UploadCollection(
	ctx context.Context,
	metadata CollectionMetadata,
	files []CollectionFile,
) (UploadResult, error)

UploadCollection streams collection members in caller order.

func (*Client) UploadDocument

func (c *Client) UploadDocument(
	ctx context.Context,
	metadata DocumentMetadata,
	document io.Reader,
) (UploadResult, error)

UploadDocument streams a multipart document upload without buffering the document in memory. The request is never retried automatically.

type CollectionFile

type CollectionFile struct {
	Name        string
	ContentType string
	Size        int64
	Reader      io.ReadSeeker
}

CollectionFile is one mode-0600 spooled collection member.

type CollectionMetadata

type CollectionMetadata = generated.CollectionMetadata

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type CollectionUpload

type CollectionUpload struct {
	Metadata CollectionMetadata
	Files    []CollectionFile
}

CollectionUpload carries a fully validated collection to the operation adapter. Readers are valid only for the duration of UploadCollection.

type DeleteResult

type DeleteResult = generated.DeleteResult

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type DeleteResultKind

type DeleteResultKind = generated.DeleteResultKind

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type DocumentMetadata

type DocumentMetadata = generated.DocumentMetadata

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type DocumentMetadataFormat

type DocumentMetadataFormat = generated.DocumentMetadataFormat

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type DocumentUpload

type DocumentUpload struct {
	Metadata DocumentMetadata
	Document io.Reader
}

DocumentUpload carries the streaming document request to the operation adapter. The Reader is valid only for the duration of UploadDocument.

type Download

type Download struct {
	Body        io.ReadCloser
	Key         string
	Filename    string
	ContentType string
}

Download is a streaming marker-declared object response.

type FileResult

type FileResult = generated.FileResult

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type GetUploadRequest

type GetUploadRequest = generated.GetUploadRequest

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type Health

type Health = generated.Health

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type HealthStatus

type HealthStatus = generated.HealthStatus

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type InspectedObject

type InspectedObject = generated.InspectedObject

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type ManifestList

type ManifestList = generated.ManifestList

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type ManifestRecord

type ManifestRecord = generated.ManifestRecord

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type ManifestRecordKind

type ManifestRecordKind = generated.ManifestRecordKind

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type ManifestRecordType

type ManifestRecordType = generated.ManifestRecordType

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type Operations

Operations is the transport boundary between HTTP and Airplan's shared operation service. Implementations contain business logic; handlers only decode, bound, authenticate, and encode requests.

type Options

type Options struct {
	Token                   string
	Logger                  *slog.Logger
	TempDir                 string
	OpenAPI                 []byte
	MaxRequestBodyBytes     int64
	MaxJSONBodyBytes        int64
	MaxDocumentBytes        int64
	MaxCollectionFileBytes  int64
	MaxCollectionTotalBytes int64
	MaxCollectionFiles      int
}

Options sets HTTP transport policy. Zero size values use conservative defaults; callers cannot disable a server hard limit.

type OriginGuard

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

OriginGuard validates present browser origins against an exact allowlist. Requests without Origin are accepted for non-browser agent clients.

func NewOriginGuard

func NewOriginGuard(origins []string) (*OriginGuard, error)

NewOriginGuard validates and stores an explicit origin allowlist.

func (*OriginGuard) Wrap

func (g *OriginGuard) Wrap(next http.Handler) http.Handler

Wrap enforces explicit Origin verification. It is intended to wrap the Streamable HTTP MCP endpoint as well as any future browser-capable route.

type Problem

type Problem = generated.Problem

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type ProblemError

type ProblemError struct {
	Problem Problem
	// contains filtered or unexported fields
}

ProblemError lets the operation adapter return a safe, typed HTTP failure.

func NewProblemError

func NewProblemError(status int, code, title, detail string) *ProblemError

NewProblemError constructs a typed problem safe to expose to clients.

func (*ProblemError) Error

func (e *ProblemError) Error() string

type PurgeCandidate

type PurgeCandidate = generated.PurgeCandidate

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type PurgeItemResult

type PurgeItemResult = generated.PurgeItemResult

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type PurgePreview

type PurgePreview = generated.PurgePreview

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type PurgePreviewRequest

type PurgePreviewRequest = generated.PurgePreviewRequest

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type PurgePreviewRequestSource

type PurgePreviewRequestSource = generated.PurgePreviewRequestSource

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type PurgeRequest

type PurgeRequest = generated.PurgeRequest

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type PurgeResult

type PurgeResult = generated.PurgeResult

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type RemoteUpload

type RemoteUpload = generated.RemoteUpload

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type RemoteUploadKind

type RemoteUploadKind = generated.RemoteUploadKind

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type Server

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

Server implements the OpenAPI-generated strict server interface around the shared Airplan operation service.

func NewServer

func NewServer(operations Operations, options Options) (*Server, error)

NewServer validates transport policy and constructs a REST adapter.

func (*Server) DeleteUpload

DeleteUpload implements the generated operation.

func (*Server) ExecutePurge

ExecutePurge implements the generated operation.

func (*Server) GetCapabilities

GetCapabilities implements the generated operation.

func (*Server) GetOpenAPI

GetOpenAPI implements the generated public schema operation.

func (*Server) GetUpload

GetUpload implements the generated streaming response operation.

func (*Server) Handler

func (s *Server) Handler() (http.Handler, error)

Handler registers the generated strict server and schema request validator, then adds authentication, size limits, and request IDs around it.

func (*Server) Health

Health implements the generated public liveness operation.

func (*Server) InspectUpload

InspectUpload implements the generated operation.

func (*Server) ListManifestUploads

ListManifestUploads implements the generated operation.

func (*Server) ListStorageUploads

ListStorageUploads implements the generated operation.

func (*Server) PreviewPurge

PreviewPurge implements the generated operation.

func (*Server) SyncManifest

SyncManifest implements the generated operation.

func (*Server) UploadCollection

UploadCollection implements the generated streaming multipart operation.

func (*Server) UploadDocument

UploadDocument implements the generated streaming multipart operation.

type StorageList

type StorageList = generated.StorageList

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type SyncFailure

type SyncFailure = generated.SyncFailure

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type SyncFailureOperation

type SyncFailureOperation = generated.SyncFailureOperation

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type SyncRequest

type SyncRequest = generated.SyncRequest

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type SyncResult

type SyncResult = generated.SyncResult

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type TargetRequest

type TargetRequest = generated.TargetRequest

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type UploadInspection

type UploadInspection = generated.UploadInspection

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type UploadInspectionKind

type UploadInspectionKind = generated.UploadInspectionKind

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type UploadInspectionState

type UploadInspectionState = generated.UploadInspectionState

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type UploadLimits

type UploadLimits = generated.UploadLimits

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type UploadResult

type UploadResult = generated.UploadResult

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

type UploadResultKind

type UploadResultKind = generated.UploadResultKind

REST wire models are aliases to the checked-in OpenAPI output. Keeping the public adapter names here avoids leaking the generated package throughout the domain layer while making schema drift a compile-time failure.

Directories

Path Synopsis
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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