transportir

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	Name             string
	HTTPName         string
	Attribute        *expr.AttributeExpr
	Required         bool
	PrimitivePointer bool
	Path             string
	Domain           string
	MaxAge           string
	Secure           bool
	HTTPOnly         bool
	SameSite         expr.CookieSameSiteValue
}

type Endpoint

type Endpoint struct {
	Service        *Service
	Name           string
	MethodName     string
	Description    string
	Meta           expr.MetaExpr
	MethodMeta     expr.MetaExpr
	MethodDocs     *expr.DocsExpr
	Generate       bool
	MethodGenerate bool
	IsJSONRPC      bool
	Request        *Request
	Response       *Response
	Routes         []*Route
	Stream         *Stream
	Redirect       *Redirect
	Security       *Security
}

func BuildEndpoint

func BuildEndpoint(endpoint *expr.HTTPEndpointExpr) *Endpoint

type Error

type Error struct {
	Name      string
	Attribute *expr.AttributeExpr
	Type      expr.DataType
	Remedy    *ErrorRemedy
}

type ErrorRemedy

type ErrorRemedy struct {
	Code        string
	SafeMessage string
	RetryHint   string
}
type Header struct {
	Name             string
	HTTPName         string
	Attribute        *expr.AttributeExpr
	Required         bool
	PrimitivePointer bool
}

type Parameter

type Parameter struct {
	Name             string
	HTTPName         string
	In               string
	Attribute        *expr.AttributeExpr
	Required         bool
	PrimitivePointer bool
	Map              bool
	MapQueryParams   *string
	StringSlice      bool
	Slice            bool
}

type Redirect

type Redirect struct {
	URL        string
	StatusCode int
}

type Request

type Request struct {
	Payload             *expr.AttributeExpr
	Body                *expr.AttributeExpr
	RawBody             *expr.AttributeExpr
	StreamingBody       *expr.AttributeExpr
	BodyOrigin          string
	PathParams          []*Parameter
	QueryParams         []*Parameter
	Headers             []*Parameter
	Cookies             []*Parameter
	MapQueryParams      *string
	Multipart           bool
	FormEncoded         bool
	OptionalBody        bool
	MustHaveBody        bool
	SkipBodyEncode      bool
	IDAttribute         string
	IDAttributeRequired bool
}

type Response

type Response struct {
	Result              *expr.AttributeExpr
	StreamingResult     *expr.AttributeExpr
	Responses           []*ResponseStatus
	ErrorResponses      []*ResponseStatus
	HasMixedResults     bool
	SkipBodyEncode      bool
	IDAttribute         string
	IDAttributeRequired bool
}
type ResponseLink struct {
	Name         string
	Operation    string
	OperationRef string
	Description  string
	RequestBody  string
	Parameters   map[string]string
}

type ResponseStatus

type ResponseStatus struct {
	Error        *Error
	StatusCode   int
	Description  string
	ContentType  string
	ContentTypes []string
	Headers      []*Header
	Cookies      []*Cookie
	Body         *expr.AttributeExpr
	DocumentBody *expr.AttributeExpr
	BodyOrigin   string
	TagName      string
	TagValue     string
	IsError      bool
	EmitExamples bool
	IsWebSocket  bool
	BinaryBody   bool
	Meta         expr.MetaExpr
	Links        []*ResponseLink
}

type Route

type Route struct {
	Index      int
	Method     string
	Path       string
	SourcePath string
	Wildcards  []string
}

func RouteForExpr

func RouteForExpr(endpoint *Endpoint, route *expr.RouteExpr, renderedPath string) *Route

type SSE

type SSE struct {
	RequestIDField   string
	RequestIDPointer bool
	DataField        string
	IDField          string
	EventField       string
	RetryField       string
}

type Security

type Security struct {
	Requirements []*expr.SecurityExpr
	Parameters   []*SecurityParameter
	Disabled     bool
}

type SecurityParameter

type SecurityParameter struct {
	Name       string
	In         string
	SchemeName string
}

type Service

type Service struct {
	Name            string
	Meta            expr.MetaExpr
	ServiceMeta     expr.MetaExpr
	Generate        bool
	ServiceGenerate bool
	Endpoints       []*Endpoint
}

func BuildService

func BuildService(service *expr.HTTPServiceExpr) *Service

type Stream

type Stream struct {
	Kind             expr.StreamKind
	Direction        string
	IsStreaming      bool
	Transport        string
	IsSSE            bool
	IsWebSocket      bool
	HasMixedResults  bool
	RequestHasBody   bool
	RequestPayload   *expr.AttributeExpr
	RequestMessage   *expr.AttributeExpr
	ResponseMessage  *expr.AttributeExpr
	HandshakeMethod  string
	HandshakeStatus  int
	HandshakeContent string
	SSE              *SSE
}

Jump to

Keyboard shortcuts

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