Documentation
¶
Index ¶
- func NewHandler(operations Operations, options Options) (http.Handler, error)
- func RequestID(ctx context.Context) string
- type BearerAuth
- type Capabilities
- type CapabilitiesAPIVersion
- type CapabilitiesUploadFormats
- type Client
- func (c *Client) Capabilities(ctx context.Context) (Capabilities, error)
- func (c *Client) DeleteUpload(ctx context.Context, request TargetRequest) (DeleteResult, error)
- func (c *Client) ExecutePurge(ctx context.Context, request PurgeRequest) (PurgeResult, error)
- func (c *Client) GetUpload(ctx context.Context, request GetUploadRequest) (Download, error)
- func (c *Client) Health(ctx context.Context) (Health, error)
- func (c *Client) InspectUpload(ctx context.Context, request TargetRequest) (UploadInspection, error)
- func (c *Client) ListManifestUploads(ctx context.Context) (ManifestList, error)
- func (c *Client) ListStorageUploads(ctx context.Context) (StorageList, error)
- func (c *Client) OpenAPI(ctx context.Context) ([]byte, error)
- func (c *Client) PreviewPurge(ctx context.Context, request PurgePreviewRequest) (PurgePreview, error)
- func (c *Client) SyncManifest(ctx context.Context, request SyncRequest) (SyncResult, error)
- func (c *Client) UploadCollection(ctx context.Context, metadata CollectionMetadata, files []CollectionFile) (UploadResult, error)
- func (c *Client) UploadDocument(ctx context.Context, metadata DocumentMetadata, document io.Reader) (UploadResult, error)
- type CollectionFile
- type CollectionMetadata
- type CollectionUpload
- type DeleteResult
- type DeleteResultKind
- type DocumentMetadata
- type DocumentMetadataFormat
- type DocumentUpload
- type Download
- type FileResult
- type GetUploadRequest
- type Health
- type HealthStatus
- type InspectedObject
- type ManifestList
- type ManifestRecord
- type ManifestRecordKind
- type ManifestRecordType
- type Operations
- type Options
- type OriginGuard
- type Problem
- type ProblemError
- type PurgeCandidate
- type PurgeItemResult
- type PurgePreview
- type PurgePreviewRequest
- type PurgePreviewRequestSource
- type PurgeRequest
- type PurgeResult
- type RemoteUpload
- type RemoteUploadKind
- type Server
- func (s *Server) DeleteUpload(ctx context.Context, request generated.DeleteUploadRequestObject) (generated.DeleteUploadResponseObject, error)
- func (s *Server) ExecutePurge(ctx context.Context, request generated.ExecutePurgeRequestObject) (generated.ExecutePurgeResponseObject, error)
- func (s *Server) GetCapabilities(ctx context.Context, _ generated.GetCapabilitiesRequestObject) (generated.GetCapabilitiesResponseObject, error)
- func (s *Server) GetOpenAPI(context.Context, generated.GetOpenAPIRequestObject) (generated.GetOpenAPIResponseObject, error)
- func (s *Server) GetUpload(ctx context.Context, request generated.GetUploadRequestObject) (generated.GetUploadResponseObject, error)
- func (s *Server) Handler() (http.Handler, error)
- func (s *Server) Health(context.Context, generated.HealthRequestObject) (generated.HealthResponseObject, error)
- func (s *Server) InspectUpload(ctx context.Context, request generated.InspectUploadRequestObject) (generated.InspectUploadResponseObject, error)
- func (s *Server) ListManifestUploads(ctx context.Context, _ generated.ListManifestUploadsRequestObject) (generated.ListManifestUploadsResponseObject, error)
- func (s *Server) ListStorageUploads(ctx context.Context, _ generated.ListStorageUploadsRequestObject) (generated.ListStorageUploadsResponseObject, error)
- func (s *Server) PreviewPurge(ctx context.Context, request generated.PreviewPurgeRequestObject) (generated.PreviewPurgeResponseObject, error)
- func (s *Server) SyncManifest(ctx context.Context, request generated.SyncManifestRequestObject) (generated.SyncManifestResponseObject, error)
- func (s *Server) UploadCollection(ctx context.Context, request generated.UploadCollectionRequestObject) (generated.UploadCollectionResponseObject, error)
- func (s *Server) UploadDocument(ctx context.Context, request generated.UploadDocumentRequestObject) (generated.UploadDocumentResponseObject, error)
- type StorageList
- type SyncFailure
- type SyncFailureOperation
- type SyncRequest
- type SyncResult
- type TargetRequest
- type UploadInspection
- type UploadInspectionKind
- type UploadInspectionState
- type UploadLimits
- type UploadResult
- type UploadResultKind
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.
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 (*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 ¶
GetUpload opens one streaming marker-declared object response. The caller must close Download.Body.
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) 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 ¶
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 ¶
type Operations interface {
Capabilities(context.Context) (Capabilities, error)
UploadDocument(context.Context, DocumentUpload) (UploadResult, error)
UploadCollection(context.Context, CollectionUpload) (UploadResult, error)
InspectUpload(context.Context, TargetRequest) (UploadInspection, error)
GetUpload(context.Context, GetUploadRequest) (Download, error)
DeleteUpload(context.Context, TargetRequest) (DeleteResult, error)
ListManifestUploads(context.Context) (ManifestList, error)
ListStorageUploads(context.Context) (StorageList, error)
SyncManifest(context.Context, SyncRequest) (SyncResult, error)
PreviewPurge(context.Context, PurgePreviewRequest) (PurgePreview, error)
ExecutePurge(context.Context, PurgeRequest) (PurgeResult, error)
}
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.
type 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 ¶
func (s *Server) DeleteUpload( ctx context.Context, request generated.DeleteUploadRequestObject, ) (generated.DeleteUploadResponseObject, error)
DeleteUpload implements the generated operation.
func (*Server) ExecutePurge ¶
func (s *Server) ExecutePurge( ctx context.Context, request generated.ExecutePurgeRequestObject, ) (generated.ExecutePurgeResponseObject, error)
ExecutePurge implements the generated operation.
func (*Server) GetCapabilities ¶
func (s *Server) GetCapabilities( ctx context.Context, _ generated.GetCapabilitiesRequestObject, ) (generated.GetCapabilitiesResponseObject, error)
GetCapabilities implements the generated operation.
func (*Server) GetOpenAPI ¶
func (s *Server) GetOpenAPI( context.Context, generated.GetOpenAPIRequestObject, ) (generated.GetOpenAPIResponseObject, error)
GetOpenAPI implements the generated public schema operation.
func (*Server) GetUpload ¶
func (s *Server) GetUpload( ctx context.Context, request generated.GetUploadRequestObject, ) (generated.GetUploadResponseObject, error)
GetUpload implements the generated streaming response operation.
func (*Server) Handler ¶
Handler registers the generated strict server and schema request validator, then adds authentication, size limits, and request IDs around it.
func (*Server) Health ¶
func (s *Server) Health( context.Context, generated.HealthRequestObject, ) (generated.HealthResponseObject, error)
Health implements the generated public liveness operation.
func (*Server) InspectUpload ¶
func (s *Server) InspectUpload( ctx context.Context, request generated.InspectUploadRequestObject, ) (generated.InspectUploadResponseObject, error)
InspectUpload implements the generated operation.
func (*Server) ListManifestUploads ¶
func (s *Server) ListManifestUploads( ctx context.Context, _ generated.ListManifestUploadsRequestObject, ) (generated.ListManifestUploadsResponseObject, error)
ListManifestUploads implements the generated operation.
func (*Server) ListStorageUploads ¶
func (s *Server) ListStorageUploads( ctx context.Context, _ generated.ListStorageUploadsRequestObject, ) (generated.ListStorageUploadsResponseObject, error)
ListStorageUploads implements the generated operation.
func (*Server) PreviewPurge ¶
func (s *Server) PreviewPurge( ctx context.Context, request generated.PreviewPurgeRequestObject, ) (generated.PreviewPurgeResponseObject, error)
PreviewPurge implements the generated operation.
func (*Server) SyncManifest ¶
func (s *Server) SyncManifest( ctx context.Context, request generated.SyncManifestRequestObject, ) (generated.SyncManifestResponseObject, error)
SyncManifest implements the generated operation.
func (*Server) UploadCollection ¶
func (s *Server) UploadCollection( ctx context.Context, request generated.UploadCollectionRequestObject, ) (generated.UploadCollectionResponseObject, error)
UploadCollection implements the generated streaming multipart operation.
func (*Server) UploadDocument ¶
func (s *Server) UploadDocument( ctx context.Context, request generated.UploadDocumentRequestObject, ) (generated.UploadDocumentResponseObject, error)
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.