transportir

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ResponseContractSuccess identifies a successful response.
	ResponseContractSuccess ResponseContractCaseKind = "success"
	// ResponseContractError identifies a service error.
	ResponseContractError ResponseContractCaseKind = "error"
	// ResponseContractNotification identifies response suppression for an ID-less request.
	ResponseContractNotification ResponseContractCaseKind = "notification"

	// ResponseContractMissingEndpoint indicates that no endpoint was supplied.
	ResponseContractMissingEndpoint ResponseContractLimitationCode = "missing_endpoint"
	// ResponseContractMissingIdentity indicates that service or method identity is unavailable.
	ResponseContractMissingIdentity ResponseContractLimitationCode = "missing_identity"
	// ResponseContractNotJSONRPC indicates that the endpoint is not JSON-RPC.
	ResponseContractNotJSONRPC ResponseContractLimitationCode = "not_jsonrpc"
	// ResponseContractStreaming indicates an unsupported stream lifecycle.
	ResponseContractStreaming ResponseContractLimitationCode = "streaming"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseContractAnalysis

type ResponseContractAnalysis struct {
	// Cases lists response branches in design order.
	Cases []*ResponseContractCase
	// Limitations explains why cases could not be produced.
	Limitations []ResponseContractLimitation
}

ResponseContractAnalysis contains supported cases or explicit limitations.

func AnalyzeResponseContractCases

func AnalyzeResponseContractCases(endpoint *expr.HTTPEndpointExpr) *ResponseContractAnalysis

AnalyzeResponseContractCases builds deterministic JSON-RPC response cases.

func (*ResponseContractAnalysis) Supported

func (a *ResponseContractAnalysis) Supported() bool

Supported reports whether cases were produced without limitations.

type ResponseContractCase

type ResponseContractCase struct {
	// ID is stable while the service contract is unchanged.
	ID string
	// Kind identifies a success, service error, or notification.
	Kind ResponseContractCaseKind
	// ResultType is the designed success result type.
	ResultType string
	// HasResult reports whether a success envelope contains a result member.
	HasResult bool
	// ErrorCode is the declared JSON-RPC error code.
	ErrorCode int
	// ErrorName is the declared service error name.
	ErrorName string
	// ErrorDataType is the designed JSON error-data type.
	ErrorDataType string
	// Stream describes a supported streaming terminal contract.
	Stream *ResponseContractStream
}

ResponseContractCase describes one declared JSON-RPC response branch.

type ResponseContractCaseKind

type ResponseContractCaseKind string

ResponseContractCaseKind identifies a JSON-RPC response branch.

type ResponseContractLimitation

type ResponseContractLimitation struct {
	// Code identifies the unsupported feature.
	Code ResponseContractLimitationCode
	// Detail explains the limitation.
	Detail string
}

ResponseContractLimitation explains an unsupported endpoint shape.

type ResponseContractLimitationCode

type ResponseContractLimitationCode string

ResponseContractLimitationCode identifies an unsupported endpoint shape.

type ResponseContractStream

type ResponseContractStream struct {
	// Transport identifies the streaming wire protocol.
	Transport string
	// Terminal identifies the expected terminal behavior.
	Terminal string
}

ResponseContractStream describes a selected JSON-RPC stream terminal.

Jump to

Keyboard shortcuts

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