Help us shape the future of Go! Take the 2026 Go Developer Survey

httprequest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package httprequest provides HTTP request node factory for the registry system.

Package httprequest provides HTTP request node implementation for workflow graph execution.

Index

Constants

View Source
const (
	OutputPortSuccess = "success"
	OutputPortError   = "error"
	InputPortMain     = "main"
)

Variables

This section is empty.

Functions

func NewHTTPRequestNodeFactory

func NewHTTPRequestNodeFactory() protocol.NodeFactory

NewHTTPRequestNodeFactory creates a new HTTP request node factory.

Types

type HTTPError

type HTTPError struct {
	StatusCode int
	Message    string
}

HTTPError represents an HTTP error with status code.

func (*HTTPError) Error

func (e *HTTPError) Error() string

type HTTPRequestConfig

type HTTPRequestConfig struct {
	URL     string            `json:"url"`
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers"`
	Body    string            `json:"body,omitempty"`
	Timeout int               `json:"timeout"`
}

HTTPRequestConfig defines the configuration for HTTP request nodes.

type HTTPRequestNode

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

HTTPRequestNode implements the Node interface for HTTP requests with multiple output ports.

func NewHTTPRequestNode

func NewHTTPRequestNode(id string, config map[string]any) (*HTTPRequestNode, error)

NewHTTPRequestNode creates a new HTTP request node.

func (*HTTPRequestNode) Execute

Execute performs the HTTP request and returns results on appropriate output ports.

func (*HTTPRequestNode) ID

func (n *HTTPRequestNode) ID() string

ID returns the node ID.

func (*HTTPRequestNode) InputPorts

func (n *HTTPRequestNode) InputPorts() []models.InputPort

InputPorts returns the input ports for the node.

func (*HTTPRequestNode) OutputPorts

func (n *HTTPRequestNode) OutputPorts() []models.OutputPort

OutputPorts returns the output ports for the node.

func (*HTTPRequestNode) Type

func (n *HTTPRequestNode) Type() string

Type returns the node type.

func (*HTTPRequestNode) Validate

func (n *HTTPRequestNode) Validate(config map[string]any) error

Validate validates the node configuration.

type HTTPRequestNodeFactory

type HTTPRequestNodeFactory struct{}

HTTPRequestNodeFactory creates HTTPRequestNode instances.

func (*HTTPRequestNodeFactory) Create

func (f *HTTPRequestNodeFactory) Create(ctx context.Context, id string, config map[string]any) (protocol.Node, error)

Create creates a new HTTPRequestNode instance.

func (*HTTPRequestNodeFactory) Description

func (f *HTTPRequestNodeFactory) Description() string

Description returns the factory description.

func (*HTTPRequestNodeFactory) ID

ID returns the factory ID.

func (*HTTPRequestNodeFactory) Name

func (f *HTTPRequestNodeFactory) Name() string

Name returns the factory name.

func (*HTTPRequestNodeFactory) Schema

func (f *HTTPRequestNodeFactory) Schema() map[string]any

Schema returns the JSON schema for HTTP request node configuration.

Jump to

Keyboard shortcuts

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