client

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "http_client"
	RequestPort   = "request"
	ResponsePort  = "response"
	ErrorPort     = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

func (*Component) GetInfo

func (h *Component) GetInfo() module.ComponentInfo

func (*Component) Handle

func (h *Component) Handle(ctx context.Context, handler module.Handler, port string, msg interface{}) error

func (*Component) Instance

func (h *Component) Instance() module.Component

func (*Component) Ports

func (h *Component) Ports() []module.Port

type Context

type Context any

type Error

type Error struct {
	Context  Context          `json:"context" configurable:"true" required:"true" title:"Context" description:"Message to be sent further"`
	Response ResponseResponse `json:"response"`
	Error    string           `json:"error" required:"true"`
}

type Request

type Request struct {
	Context Context        `json:"context,omitempty" configurable:"true" title:"Context" description:"Message to be sent further"`
	Request RequestRequest `json:"request" title:"Request" required:"true" description:"HTTP Request"`

	ResponseContentType etc.ContentType `json:"responseContentType,omitempty" title:"Response Content Type" description:"Override response content type"`
	ResponseBody        ResponseBody    `json:"responseBody" configurable:"true" title:"Response Body Example" description:"Define response body struct"`
}

type RequestRequest

type RequestRequest struct {
	Method  string `` /* 137-byte string literal not displayed */
	Timeout int    `json:"timeout" required:"true" title:"Request Timeout" colSpan:"col-span-6"`

	URL         string          `json:"url" required:"true" title:"URL" format:"uri"`
	ContentType etc.ContentType `json:"contentType" title:"Request Content Type" required:"true"`
	Headers     []etc.Header    `json:"headers,omitempty" title:"Headers"`
	Body        any             `json:"body" configurable:"true" title:"Request Body"`
}

type Response

type Response struct {
	Context  Context          `json:"context" configurable:"true" required:"true" title:"Context" description:"Message to be sent further"`
	Response ResponseResponse `json:"response" title:"Response" required:"true" description:"HTTP Response"`
}

type ResponseBody

type ResponseBody any

type ResponseResponse

type ResponseResponse struct {
	Headers    []etc.Header `json:"headers" required:"true" title:"Headers"`
	Status     string       `json:"status"`
	StatusCode int          `json:"statusCode"`
	Body       ResponseBody `json:"body" configurable:"false" title:"Body"`
}

type Settings

type Settings struct {
	EnableErrorPort bool `` /* 137-byte string literal not displayed */
}

Jump to

Keyboard shortcuts

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