Documentation
¶
Overview ¶
Package httpjson will expose DKIM2 service operations over HTTP and JSON.
Index ¶
- Constants
- func IsMappingError(err error, code MappingErrorCode) bool
- func IsServerConnContextFailure(value any) bool
- func IsServerRuntimeError(err error) bool
- func IsStrictAdapterError(err error, class strictFailureClass) bool
- func IsValidationError(err error) bool
- func MapBatchRevisionRequest(input generated.BatchRevisionRequest) (app.BatchRevisionRequest, error)
- func MapBatchRevisionResult(result app.BatchRevisionResult) (generated.BatchRevisionResponse, error)
- func MapDeliveryStatusRequest(input generated.DSNSignRequest) (app.DeliveryStatusRequest, error)
- func MapInboundResult(result app.InboundResult, authservID string) (generated.ProcessResponse, error)
- func MapOperationResult(result app.OperationResult) (generated.OperationResponse, error)
- func MapPropagationCommitRequest(input generated.DSNPropagateCommitRequest) (string, error)
- func MapPropagationCommitResult(state app.PropagationCommitState) (generated.DSNPropagateCommitResponse, error)
- func MapPropagationRequest(input generated.DSNPropagateRequest) (app.PropagationRequest, error)
- func MapPropagationResult(result app.PropagationResult) (generated.DSNPropagateResponse, error)
- func MapReviseRequest(input generated.ReviseRequest) (app.OperationRequest, error)
- func MapSignRequest(input generated.SignRequest) (app.OperationRequest, error)
- type BoundaryConfig
- type DomainProjection
- type DomainRequest
- func (r DomainRequest) AuthservID() string
- func (DomainRequest) Format(state fmt.State, _ rune)
- func (DomainRequest) GoString() string
- func (r DomainRequest) InboundRequest() (app.InboundRequest, error)
- func (DomainRequest) MarshalJSON() ([]byte, error)
- func (DomainRequest) MarshalText() ([]byte, error)
- func (DomainRequest) String() string
- func (r DomainRequest) Tenant() string
- func (r DomainRequest) VerifyRequest() (dkim2.VerifyRequest, error)
- type FatalNotifier
- type FinalDisposition
- type HTTPBoundary
- type HandlerRegistrationGate
- func (g *HandlerRegistrationGate) Close()
- func (*HandlerRegistrationGate) Format(state fmt.State, _ rune)
- func (*HandlerRegistrationGate) GoString() string
- func (*HandlerRegistrationGate) MarshalJSON() ([]byte, error)
- func (*HandlerRegistrationGate) MarshalText() ([]byte, error)
- func (g *HandlerRegistrationGate) Open() bool
- func (g *HandlerRegistrationGate) Quiescent() bool
- func (g *HandlerRegistrationGate) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (*HandlerRegistrationGate) String() string
- func (g *HandlerRegistrationGate) Wait(ctx context.Context) error
- type MappingError
- type MappingErrorCode
- type RequestValidator
- func (RequestValidator) Format(state fmt.State, _ rune)
- func (RequestValidator) GoString() string
- func (RequestValidator) String() string
- func (v *RequestValidator) ValidateOperation(request *http.Request, body []byte) error
- func (v *RequestValidator) ValidateProcess(request *http.Request, body []byte) error
- type ServerFactory
- func (f *ServerFactory) Assemble(input app.HTTPAssemblyInput) (app.HTTPAssembly, error)
- func (*ServerFactory) Format(state fmt.State, _ rune)
- func (*ServerFactory) GoString() string
- func (*ServerFactory) MarshalJSON() ([]byte, error)
- func (*ServerFactory) MarshalText() ([]byte, error)
- func (*ServerFactory) String() string
- type ServerListener
- func (l *ServerListener) Accept() (net.Conn, error)
- func (l *ServerListener) Addr() net.Addr
- func (l *ServerListener) Close() error
- func (l *ServerListener) ConnContext(ctx context.Context, connection net.Conn) context.Context
- func (*ServerListener) Format(state fmt.State, _ rune)
- func (*ServerListener) GoString() string
- func (*ServerListener) MarshalJSON() ([]byte, error)
- func (*ServerListener) MarshalText() ([]byte, error)
- func (*ServerListener) String() string
- type ValidationError
Constants ¶
const ( // FinalDispositionAccept permits normal continuation. FinalDispositionAccept = outcome.DispositionAccept // FinalDispositionReject reports permanent local rejection. FinalDispositionReject = outcome.DispositionReject // FinalDispositionTempfail requests a retryable deferral. FinalDispositionTempfail = outcome.DispositionTempfail // FinalDispositionContinue withholds a terminal daemon decision. FinalDispositionContinue = outcome.DispositionContinue )
Variables ¶
This section is empty.
Functions ¶
func IsMappingError ¶
func IsMappingError(err error, code MappingErrorCode) bool
IsMappingError reports whether err belongs to one closed mapper class.
func IsServerConnContextFailure ¶
IsServerConnContextFailure reports whether a recovered panic is the private content-free connection-context invariant used by the guarded serve owner.
func IsServerRuntimeError ¶
IsServerRuntimeError reports whether an error belongs to the stable HTTP server ownership class.
func IsStrictAdapterError ¶
IsStrictAdapterError reports whether err belongs to one closed adapter class.
func IsValidationError ¶
IsValidationError reports whether err belongs to the closed validator class.
func MapBatchRevisionRequest ¶
func MapBatchRevisionRequest(input generated.BatchRevisionRequest) (app.BatchRevisionRequest, error)
MapBatchRevisionRequest converts the generated complete-fanout contract to immutable domain evidence under the default aggregate message bound.
func MapBatchRevisionResult ¶
func MapBatchRevisionResult(result app.BatchRevisionResult) (generated.BatchRevisionResponse, error)
MapBatchRevisionResult exposes only exact completed header fields and bound content digests.
func MapDeliveryStatusRequest ¶
func MapDeliveryStatusRequest(input generated.DSNSignRequest) (app.DeliveryStatusRequest, error)
MapDeliveryStatusRequest maps one generated DSN-sign request to the dedicated daemon-owned evidence request.
func MapInboundResult ¶
func MapInboundResult( result app.InboundResult, authservID string, ) (generated.ProcessResponse, error)
MapInboundResult maps one complete app result into the exact generated process response.
func MapOperationResult ¶
func MapOperationResult(result app.OperationResult) (generated.OperationResponse, error)
MapOperationResult projects only complete signing-engine fields into an action plan.
func MapPropagationCommitRequest ¶
func MapPropagationCommitRequest(input generated.DSNPropagateCommitRequest) (string, error)
MapPropagationCommitRequest extracts one bounded opaque commit token.
func MapPropagationCommitResult ¶
func MapPropagationCommitResult( state app.PropagationCommitState, ) (generated.DSNPropagateCommitResponse, error)
MapPropagationCommitResult projects one closed commit state. An unresolved token has no success representation: the route answers 409 instead, so that the caller defers rather than leaving a coordinate uncommitted.
func MapPropagationRequest ¶
func MapPropagationRequest(input generated.DSNPropagateRequest) (app.PropagationRequest, error)
MapPropagationRequest maps one generated propagation request to the daemon-owned domain request. The route admits exactly the null reverse path and one forward path; the signing domain is never a request member.
func MapPropagationResult ¶
func MapPropagationResult(result app.PropagationResult) (generated.DSNPropagateResponse, error)
MapPropagationResult projects one coherent domain result into the generated response. It refuses every incoherent result, disposition, failure, and output combination so that an internal regression never reaches the wire. The delivery-status member is omitted when the evaluation never ran, so the response never carries a fabricated structure verdict.
func MapReviseRequest ¶
func MapReviseRequest(input generated.ReviseRequest) (app.OperationRequest, error)
MapReviseRequest maps one generated ordinary-transit request to domain-owned values.
func MapSignRequest ¶
func MapSignRequest(input generated.SignRequest) (app.OperationRequest, error)
MapSignRequest maps one generated originator request to domain-owned values. The null_sender declaration is required exactly for a null reverse path.
Types ¶
type BoundaryConfig ¶
type BoundaryConfig struct {
// MessageBytes bounds each decoded RFC 5322 input; zero selects 32 MiB.
MessageBytes int
Authority string
RequestDeadline time.Duration
MaxInFlight int
MaxWaiters int
AdmissionWait time.Duration
// WorkingSetBytes is the process working-set budget; zero selects 8 GiB.
WorkingSetBytes uint64
// BatchAggregateBytes enables a dedicated batch-revision sizing and
// admission pool whose decoded aggregate is at most this value. Zero keeps
// batch requests on the shared single-message sizing.
BatchAggregateBytes int
// BatchMaxInFlight is the dedicated batch permit count; zero selects one.
BatchMaxInFlight int
}
BoundaryConfig contains the immutable HTTP containment policy.
type DomainProjection ¶
type DomainProjection struct {
// contains filtered or unexported fields
}
DomainProjection owns mapped success DTOs behind a formatting-safe package boundary.
func MapDomainResult ¶
func MapDomainResult(result dkim2.VerifyResult, decision dkim2.PolicyDecision) (DomainProjection, error)
MapDomainResult maps one complete verification and local-policy result atomically.
func (DomainProjection) Format ¶
func (DomainProjection) Format(state fmt.State, _ rune)
Format prevents formatting from traversing response identifiers.
func (DomainProjection) GoString ¶
func (DomainProjection) GoString() string
GoString returns a content-free Go-syntax representation.
func (DomainProjection) MarshalJSON ¶
func (DomainProjection) MarshalJSON() ([]byte, error)
MarshalJSON rejects serialization outside the future package-owned wire assembler.
func (DomainProjection) MarshalText ¶
func (DomainProjection) MarshalText() ([]byte, error)
MarshalText rejects diagnostic text serialization of response identifiers.
func (DomainProjection) String ¶
func (DomainProjection) String() string
String returns a content-free mapped-result representation.
type DomainRequest ¶
type DomainRequest struct {
// contains filtered or unexported fields
}
DomainRequest owns one byte-preserving request mapped away from generated DTOs.
func MapProcessRequest ¶
func MapProcessRequest(input generated.ProcessRequest) (DomainRequest, error)
MapProcessRequest maps decoded values after lexical, schema, and resource preflight.
The decoded generated wrapper cannot prove the spelling of the original JSON string token; the HTTP lexical preflight owns rejection of escaped-equivalent Base64 spellings. This mapper validates the decoded canonical Base64 value and preserves exact message and SMTP bytes.
func (DomainRequest) AuthservID ¶
func (r DomainRequest) AuthservID() string
AuthservID returns the optional validated local reporting authority.
func (DomainRequest) Format ¶
func (DomainRequest) Format(state fmt.State, _ rune)
Format prevents formatting verbs from traversing request bytes.
func (DomainRequest) GoString ¶
func (DomainRequest) GoString() string
GoString returns a content-free Go-syntax representation.
func (DomainRequest) InboundRequest ¶
func (r DomainRequest) InboundRequest() (app.InboundRequest, error)
InboundRequest returns the app-owned request with its optional tenant.
func (DomainRequest) MarshalJSON ¶
func (DomainRequest) MarshalJSON() ([]byte, error)
MarshalJSON rejects serialization outside the package-owned request assembler.
func (DomainRequest) MarshalText ¶
func (DomainRequest) MarshalText() ([]byte, error)
MarshalText rejects diagnostic serialization of request bytes.
func (DomainRequest) String ¶
func (DomainRequest) String() string
String returns a content-free diagnostic representation.
func (DomainRequest) Tenant ¶
func (r DomainRequest) Tenant() string
Tenant returns the optional validated request tenant.
func (DomainRequest) VerifyRequest ¶
func (r DomainRequest) VerifyRequest() (dkim2.VerifyRequest, error)
VerifyRequest returns the stored immutable library request by value.
type FatalNotifier ¶
type FatalNotifier interface {
NotifyFatal()
}
FatalNotifier marks readiness false and requests orderly process shutdown.
type FinalDisposition ¶
type FinalDisposition = outcome.FinalDisposition
FinalDisposition is the transport-neutral daemon outcome vocabulary.
type HTTPBoundary ¶
type HTTPBoundary struct {
// contains filtered or unexported fields
}
HTTPBoundary owns route, admission, validation, and generated-adapter ordering.
func NewHTTPBoundary ¶
func NewHTTPBoundary( config BoundaryConfig, matcher capabilityMatcher, readiness readinessSource, processor inboundProcessService, notifier FatalNotifier, validator *RequestValidator, dependencies ...any, ) (*HTTPBoundary, error)
NewHTTPBoundary constructs one immutable process-local HTTP handler.
func (*HTTPBoundary) Close ¶
func (h *HTTPBoundary) Close()
Close rejects new process admission and interrupts ordinary waiters.
func (*HTTPBoundary) ServeHTTP ¶
func (h *HTTPBoundary) ServeHTTP(writer http.ResponseWriter, request *http.Request)
ServeHTTP applies the frozen outer precedence and one-operation policy.
type HandlerRegistrationGate ¶
type HandlerRegistrationGate struct {
// contains filtered or unexported fields
}
HandlerRegistrationGate linearizes handler entry against instance shutdown.
func NewHandlerRegistrationGate ¶
func NewHandlerRegistrationGate(next http.Handler) (*HandlerRegistrationGate, error)
NewHandlerRegistrationGate constructs a closed-until-open handler owner.
func (*HandlerRegistrationGate) Close ¶
func (g *HandlerRegistrationGate) Close()
Close stops future registration without waiting for active handlers.
func (*HandlerRegistrationGate) Format ¶
func (*HandlerRegistrationGate) Format(state fmt.State, _ rune)
Format prevents formatting verbs from traversing retained handler state.
func (*HandlerRegistrationGate) GoString ¶
func (*HandlerRegistrationGate) GoString() string
GoString returns a content-free Go-syntax registration-gate representation.
func (*HandlerRegistrationGate) MarshalJSON ¶
func (*HandlerRegistrationGate) MarshalJSON() ([]byte, error)
MarshalJSON rejects serialization of retained handler state.
func (*HandlerRegistrationGate) MarshalText ¶
func (*HandlerRegistrationGate) MarshalText() ([]byte, error)
MarshalText rejects diagnostic serialization of retained handler state.
func (*HandlerRegistrationGate) Open ¶
func (g *HandlerRegistrationGate) Open() bool
Open permits handler registration until the monotonic stopped transition.
func (*HandlerRegistrationGate) Quiescent ¶
func (g *HandlerRegistrationGate) Quiescent() bool
Quiescent reports whether registration is closed and no admitted handler remains active.
func (*HandlerRegistrationGate) ServeHTTP ¶
func (g *HandlerRegistrationGate) ServeHTTP( writer http.ResponseWriter, request *http.Request, )
ServeHTTP registers before any boundary or dependency work and releases the registration on every ordinary, abort, and panic path.
func (*HandlerRegistrationGate) String ¶
func (*HandlerRegistrationGate) String() string
String returns a content-free registration-gate representation.
type MappingError ¶
type MappingError struct {
// contains filtered or unexported fields
}
MappingError reports one bounded mapper failure without retaining input.
func (*MappingError) Code ¶
func (e *MappingError) Code() MappingErrorCode
Code returns the closed mapper failure class.
func (*MappingError) Error ¶
func (*MappingError) Error() string
Error returns a constant content-free mapper diagnostic.
func (*MappingError) Is ¶
func (e *MappingError) Is(target error) bool
Is supports errors.Is without exposing a wrapped cause.
type MappingErrorCode ¶
type MappingErrorCode uint8
MappingErrorCode identifies one content-free mapper failure class.
const ( // MappingInvalidContract reports invalid or noncanonical transport values. MappingInvalidContract MappingErrorCode = iota + 1 // MappingRequestTooLarge reports a request resource bound. MappingRequestTooLarge // MappingInternalContract reports an impossible domain result. MappingInternalContract )
type RequestValidator ¶
type RequestValidator struct {
// contains filtered or unexported fields
}
RequestValidator owns the immutable embedded OpenAPI router and filter options.
func NewRequestValidator ¶
func NewRequestValidator() (*RequestValidator, error)
NewRequestValidator loads and validates the embedded contract without external references.
func (RequestValidator) Format ¶
func (RequestValidator) Format(state fmt.State, _ rune)
Format prevents formatting from traversing validator internals.
func (RequestValidator) GoString ¶
func (RequestValidator) GoString() string
GoString returns a content-free validator representation.
func (RequestValidator) String ¶
func (RequestValidator) String() string
String returns a content-free validator representation.
func (*RequestValidator) ValidateOperation ¶
func (v *RequestValidator) ValidateOperation(request *http.Request, body []byte) error
ValidateOperation validates one body snapshot through its exact embedded process, sign, or revise operation.
func (*RequestValidator) ValidateProcess ¶
func (v *RequestValidator) ValidateProcess(request *http.Request, body []byte) error
ValidateProcess validates one body snapshot through the exact embedded operation.
type ServerFactory ¶
type ServerFactory struct {
// contains filtered or unexported fields
}
ServerFactory performs pure HTTP transport assembly.
func NewServerFactory ¶
func NewServerFactory() *ServerFactory
NewServerFactory constructs the production HTTP transport factory without acquiring any runtime resource.
func (*ServerFactory) Assemble ¶
func (f *ServerFactory) Assemble(input app.HTTPAssemblyInput) (app.HTTPAssembly, error)
Assemble validates one immutable app snapshot and constructs its pure HTTP transport graph without opening a listener.
func (*ServerFactory) Format ¶
func (*ServerFactory) Format(state fmt.State, _ rune)
Format prevents formatting verbs from traversing factory dependencies.
func (*ServerFactory) GoString ¶
func (*ServerFactory) GoString() string
GoString returns a constant content-free factory representation.
func (*ServerFactory) MarshalJSON ¶
func (*ServerFactory) MarshalJSON() ([]byte, error)
MarshalJSON rejects serialization of factory dependencies.
func (*ServerFactory) MarshalText ¶
func (*ServerFactory) MarshalText() ([]byte, error)
MarshalText rejects text serialization of factory dependencies.
func (*ServerFactory) String ¶
func (*ServerFactory) String() string
String returns a constant content-free factory representation.
type ServerListener ¶
type ServerListener struct {
// contains filtered or unexported fields
}
ServerListener exposes only the tracked listener operations needed by an instance-owned HTTP server.
func NewServerListener ¶
func NewServerListener( listener net.Listener, dateProvider func() (string, bool), ) (*ServerListener, error)
NewServerListener constructs the fixed-cap server listener boundary.
func (*ServerListener) Accept ¶
func (l *ServerListener) Accept() (net.Conn, error)
Accept returns one connection owned by the tracked transport boundary.
func (*ServerListener) Addr ¶
func (l *ServerListener) Addr() net.Addr
Addr returns the configured listener address without exposing its owner.
func (*ServerListener) Close ¶
func (l *ServerListener) Close() error
Close interrupts accept and closes the tracked listener exactly once.
func (*ServerListener) ConnContext ¶
ConnContext installs private tracked-connection state on the exact instance-owned server base context.
func (*ServerListener) Format ¶
func (*ServerListener) Format(state fmt.State, _ rune)
Format prevents formatting verbs from traversing retained listener state.
func (*ServerListener) GoString ¶
func (*ServerListener) GoString() string
GoString returns a content-free Go-syntax listener representation.
func (*ServerListener) MarshalJSON ¶
func (*ServerListener) MarshalJSON() ([]byte, error)
MarshalJSON rejects serialization of retained listener state.
func (*ServerListener) MarshalText ¶
func (*ServerListener) MarshalText() ([]byte, error)
MarshalText rejects diagnostic serialization of retained listener state.
func (*ServerListener) String ¶
func (*ServerListener) String() string
String returns a content-free listener representation.
type ValidationError ¶
type ValidationError struct{}
ValidationError reports a closed runtime OpenAPI failure.
func (*ValidationError) Error ¶
func (*ValidationError) Error() string
Error returns a constant content-free validation diagnostic.
func (*ValidationError) Is ¶
func (*ValidationError) Is(target error) bool
Is recognizes the bounded validator failure type.
Source Files
¶
- admission.go
- batch_capabilities.go
- batch_revision.go
- batch_revision_preflight.go
- body_preflight.go
- doc.go
- handler_adapter.go
- http_boundary.go
- http_capability.go
- http_conditionals.go
- http_media.go
- http_wire_response.go
- json_preflight.go
- known_fields.go
- message_size.go
- operations.go
- propagation.go
- request.go
- response.go
- server_factory.go
- server_lifecycle.go
- server_runtime.go
- transport_head.go
- transport_listener.go
- transport_response.go
- validator.go
- working_set.go