Documentation
¶
Overview ¶
Package testclient will contain OpenAPI-backed test-client workflows for exercising dkim2d through its public HTTP contract.
Index ¶
- func DurationBucket(duration time.Duration) string
- func ErrorWasReported(err error) bool
- func HasExitClass(err error) bool
- func NewExitError(class ExitClass) error
- func ParseServerURL(raw string) (*url.URL, error)
- func WriteFailure(output io.Writer, class ExitClass) error
- type Application
- type Capability
- type ExecutionPlan
- type ExitClass
- type Operation
- type Options
- type ResponseFact
- type ResultDeliveryStatus
- type ResultRecord
- type Runtime
- func (r *Runtime) CallDSNPropagate(ctx context.Context, request generated.DSNPropagateRequest, ...) (ResponseFact, error)
- func (r *Runtime) CallDSNPropagateCommit(ctx context.Context, request generated.DSNPropagateCommitRequest, ...) (ResponseFact, error)
- func (r *Runtime) CallDSNSign(ctx context.Context, request generated.DSNSignRequest, ...) (ResponseFact, error)
- func (r *Runtime) CallHealth(ctx context.Context) (ResponseFact, error)
- func (r *Runtime) CallNegative(ctx context.Context, mutation string, capability *Capability) (ResponseFact, error)
- func (r *Runtime) CallNegativeOperation(ctx context.Context, operation Operation, mutation string, ...) (ResponseFact, error)
- func (r *Runtime) CallProcess(ctx context.Context, request generated.ProcessRequest, ...) (ResponseFact, error)
- func (r *Runtime) CallReadiness(ctx context.Context) (ResponseFact, error)
- func (r *Runtime) CallRevise(ctx context.Context, request generated.ReviseRequest, ...) (ResponseFact, error)
- func (r *Runtime) CallSign(ctx context.Context, request generated.SignRequest, ...) (ResponseFact, error)
- func (r *Runtime) Close() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationBucket ¶
DurationBucket returns a bounded nonnumeric diagnostic class.
func ErrorWasReported ¶
ErrorWasReported reports whether JSONL output already represents the failure.
func HasExitClass ¶
HasExitClass reports whether an error originated from the stable class boundary.
func NewExitError ¶
NewExitError constructs a content-free classified error.
func ParseServerURL ¶
ParseServerURL accepts only one canonical loopback HTTP authority.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application owns one command invocation and its deterministic output.
func NewApplication ¶
func NewApplication(output io.Writer) *Application
NewApplication constructs one command-scoped test client application.
func (*Application) Run ¶
func (a *Application) Run(options Options, paths []string) error
Run executes one completely validated deterministic fixture plan.
type Capability ¶
type Capability struct {
// contains filtered or unexported fields
}
Capability owns one exact local process capability until Close.
func LoadCapability ¶
func LoadCapability(path string) (*Capability, error)
LoadCapability opens and validates one protected capability through one descriptor.
func LoadCapabilityForOperation ¶
func LoadCapabilityForOperation(path string, operation Operation) (*Capability, error)
LoadCapabilityForOperation binds protected bytes to exactly one generated route.
func (*Capability) Close ¶
func (c *Capability) Close() error
Close zeroes the owned array and rejects later request editing.
func (*Capability) EditRequest ¶
EditRequest attaches the capability to exactly one otherwise-uncredentialed request.
func (*Capability) Format ¶
func (c *Capability) Format(state fmt.State, _ rune)
Format makes every fmt verb content-free.
func (*Capability) GoString ¶
func (c *Capability) GoString() string
GoString returns a content-free Go-syntax diagnostic representation.
func (*Capability) String ¶
func (c *Capability) String() string
String returns a content-free diagnostic representation.
type ExecutionPlan ¶
type ExecutionPlan struct {
// contains filtered or unexported fields
}
ExecutionPlan is one immutable deterministic set of validated cases.
func LoadExecutionPlan ¶
func LoadExecutionPlan(paths []string) (ExecutionPlan, error)
LoadExecutionPlan validates every path and document before returning a plan.
func (ExecutionPlan) FixtureIdentifiers ¶
func (p ExecutionPlan) FixtureIdentifiers() []string
FixtureIdentifiers returns a defensive copy of deterministic fixture IDs.
type ExitClass ¶
type ExitClass uint8
ExitClass is the stable process exit status for one closed failure class.
const ( // ExitOK reports that every requested case matched. ExitOK ExitClass = 0 // ExitUsage reports command shape or flag validation failure. ExitUsage ExitClass = 2 // ExitFixture reports fixture loading or validation failure. ExitFixture ExitClass = 3 // ExitCapability reports protected capability loading failure. ExitCapability ExitClass = 4 // ExitTransport reports local transport or deadline failure. ExitTransport ExitClass = 5 // ExitContract reports malformed or unsupported response contracts. ExitContract ExitClass = 6 // ExitMismatch reports a valid response that did not match expectations. ExitMismatch ExitClass = 7 // ExitInternal reports an internal invariant failure. ExitInternal ExitClass = 8 )
func ExitClassOf ¶
ExitClassOf returns the stable class or the internal class for unknown errors.
func (ExitClass) ValidFailure ¶
ValidFailure reports whether the class is one of the declared nonzero exits.
type Operation ¶
type Operation string
Operation is the closed generated-client operation vocabulary.
const ( // OperationHealth identifies the generated liveness call. OperationHealth Operation = "health" // OperationReadiness identifies the generated readiness call. OperationReadiness Operation = "readiness" // OperationProcess identifies the generated inbound process call. OperationProcess Operation = "process" // OperationSign identifies the generated originator-signing call. OperationSign Operation = "sign" // OperationRevise identifies the generated ordinary-transit revision call. OperationRevise Operation = "revise" // OperationDSNSign identifies the dedicated delivery-status signing call. OperationDSNSign Operation = "sign_dsn" // OperationDSNPropagate identifies the delivery-status propagation call. OperationDSNPropagate Operation = "propagate_dsn" // OperationDSNPropagateCommit identifies the propagation-coordinate commit call. OperationDSNPropagateCommit Operation = "commit_dsn_propagation" )
type Options ¶
type Options struct {
ServerURL string
Timeout time.Duration
CapabilityFile string
SignCapabilityFile string
ReviseCapabilityFile string
DSNSignCapabilityFile string
DSNPropagateCapabilityFile string
Output string
}
Options owns the validated command-wide authority and resource bounds.
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the closed local-only command defaults.
type ResponseFact ¶
type ResponseFact struct {
Operation Operation
Status int
Health *generated.HealthResponse
Readiness *generated.ReadinessResponse
Process *generated.ProcessResponse
Sign *generated.OperationResponse
Revise *generated.OperationResponse
DSNSign *generated.OperationResponse
// DSNPropagate holds the route-specific propagation response.
DSNPropagate *generated.DSNPropagateResponse
// DSNCommit holds the propagation-coordinate commit response.
DSNCommit *generated.DSNPropagateCommitResponse
Error *generated.ErrorResponse
}
ResponseFact is the bounded typed result of one generated operation.
type ResultDeliveryStatus ¶
type ResultDeliveryStatus struct {
Structure string `json:"structure"`
Embedded string `json:"embedded"`
OuterAlignment string `json:"outer_alignment"`
RecipientLinkage string `json:"recipient_linkage"`
LocalHop string `json:"local_hop"`
Propagation string `json:"propagation"`
}
ResultDeliveryStatus is the stable closed projection of the received delivery-status evaluation. Every member is a closed vocabulary value; no address, message byte, or identifier enters this record.
type ResultRecord ¶
type ResultRecord struct {
Schema string `json:"schema"`
Draft string `json:"draft"`
Fixture *string `json:"fixture"`
Case *string `json:"case"`
Operation *string `json:"operation"`
Outcome string `json:"outcome"`
HTTPStatus *int `json:"http_status"`
ErrorClass *string `json:"error_class"`
DurationBucket *string `json:"duration_bucket"`
Disposition *string `json:"disposition"`
VerificationState *string `json:"verification_state"`
AuthenticationState *string `json:"authentication_state"`
PolicyVerdict *string `json:"policy_verdict"`
ReplayClass *string `json:"replay_class"`
// PropagationResult is the closed propagation-route operation result.
PropagationResult *string `json:"propagation_result"`
// PropagationDisposition is the closed propagation-route disposition.
PropagationDisposition *string `json:"propagation_disposition"`
// PropagationFailure is the closed permanent propagation failure reason.
PropagationFailure *string `json:"propagation_failure"`
// PropagationState is the closed committed-coordinate state.
PropagationState *string `json:"propagation_state"`
// PropagationDigest is the lowercase hexadecimal SHA-256 of the signed
// notification. The notification bytes themselves never reach the output.
PropagationDigest *string `json:"propagation_digest"`
// DeliveryStatus is the closed received delivery-status projection.
DeliveryStatus *ResultDeliveryStatus `json:"delivery_status"`
}
ResultRecord is the exact stable JSONL projection for one executed case.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime owns one generated client and one bounded local HTTP transport.
func NewRuntime ¶
NewRuntime constructs a generated client over one bounded loopback transport.
func NewRuntimeWithDoer ¶
func NewRuntimeWithDoer(serverURL string, doer generated.HttpRequestDoer) (*Runtime, error)
NewRuntimeWithDoer constructs a generated boundary for deterministic transport tests.
func (*Runtime) CallDSNPropagate ¶
func (r *Runtime) CallDSNPropagate( ctx context.Context, request generated.DSNPropagateRequest, editor generated.RequestEditorFn, ) (ResponseFact, error)
CallDSNPropagate executes and strictly classifies delivery-status propagation.
func (*Runtime) CallDSNPropagateCommit ¶
func (r *Runtime) CallDSNPropagateCommit( ctx context.Context, request generated.DSNPropagateCommitRequest, editor generated.RequestEditorFn, ) (ResponseFact, error)
CallDSNPropagateCommit executes and strictly classifies the coordinate commit.
func (*Runtime) CallDSNSign ¶
func (r *Runtime) CallDSNSign( ctx context.Context, request generated.DSNSignRequest, editor generated.RequestEditorFn, ) (ResponseFact, error)
CallDSNSign executes and strictly classifies dedicated delivery-status signing.
func (*Runtime) CallHealth ¶
func (r *Runtime) CallHealth(ctx context.Context) (ResponseFact, error)
CallHealth executes and strictly classifies the generated health operation.
func (*Runtime) CallNegative ¶
func (r *Runtime) CallNegative( ctx context.Context, mutation string, capability *Capability, ) (ResponseFact, error)
CallNegative executes one closed raw-contract mutation.
func (*Runtime) CallNegativeOperation ¶
func (r *Runtime) CallNegativeOperation( ctx context.Context, operation Operation, mutation string, capability *Capability, ) (ResponseFact, error)
CallNegativeOperation executes one closed raw mutation on one declared route.
func (*Runtime) CallProcess ¶
func (r *Runtime) CallProcess( ctx context.Context, request generated.ProcessRequest, editor generated.RequestEditorFn, ) (ResponseFact, error)
CallProcess executes and strictly classifies the generated authenticated process operation.
func (*Runtime) CallReadiness ¶
func (r *Runtime) CallReadiness(ctx context.Context) (ResponseFact, error)
CallReadiness executes and strictly classifies the generated readiness operation.
func (*Runtime) CallRevise ¶
func (r *Runtime) CallRevise( ctx context.Context, request generated.ReviseRequest, editor generated.RequestEditorFn, ) (ResponseFact, error)
CallRevise executes and strictly classifies the generated revision operation.
func (*Runtime) CallSign ¶
func (r *Runtime) CallSign( ctx context.Context, request generated.SignRequest, editor generated.RequestEditorFn, ) (ResponseFact, error)
CallSign executes and strictly classifies the generated originator operation.