http

package
v19.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package http implements the built-in AutoFlow module that calls arbitrary HTTP endpoints.

Requests go to the URL the script names, over a net/http transport of the module's own. No Relay credential is attached to them: whatever authenticates a request is in the headers the script passes.

Index

Constants

View Source
const (
	ModuleName = "http"
)

Variables

View Source
var File_internal_module_autoflow_builtin_modules_http_params_proto protoreflect.FileDescriptor

Functions

func New

func New(marshaler prototool.Marshaler, transport http.RoundTripper, outboundRequests metric.Int64Counter) *pkg_autoflow.ModuleImpl

New returns the 'http' module, which lets workflow scripts call arbitrary HTTP endpoints:

load("module:http", "request", "post_value")

def main(w):
    status, headers, body, err = gather(request("GET", "https://example.com/healthz"))
    reply = channel()
    status, headers, body, err = gather(post_value("https://example.com/v1/questions", value={"reply": reply}))

Types

type PostValueBody

type PostValueBody struct {
	Value         *v1.Value          `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
	ChannelTokens []*v1.ChannelToken `protobuf:"bytes,2,rep,name=channel_tokens,json=channelTokens" json:"channel_tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*PostValueBody) Descriptor deprecated

func (*PostValueBody) Descriptor() ([]byte, []int)

Deprecated: Use PostValueBody.ProtoReflect.Descriptor instead.

func (*PostValueBody) GetChannelTokens

func (x *PostValueBody) GetChannelTokens() []*v1.ChannelToken

func (*PostValueBody) GetValue

func (x *PostValueBody) GetValue() *v1.Value

func (*PostValueBody) ProtoMessage

func (*PostValueBody) ProtoMessage()

func (*PostValueBody) ProtoReflect

func (x *PostValueBody) ProtoReflect() protoreflect.Message

func (*PostValueBody) Reset

func (x *PostValueBody) Reset()

func (*PostValueBody) String

func (x *PostValueBody) String() string

type PostValueParams

type PostValueParams struct {
	Url     *string   `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
	Value   *v1.Value `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	Headers *v1.Value `protobuf:"bytes,3,opt,name=headers" json:"headers,omitempty"`
	// contains filtered or unexported fields
}

func (*PostValueParams) Descriptor deprecated

func (*PostValueParams) Descriptor() ([]byte, []int)

Deprecated: Use PostValueParams.ProtoReflect.Descriptor instead.

func (*PostValueParams) GetHeaders

func (x *PostValueParams) GetHeaders() *v1.Value

func (*PostValueParams) GetUrl

func (x *PostValueParams) GetUrl() string

func (*PostValueParams) GetValue

func (x *PostValueParams) GetValue() *v1.Value

func (*PostValueParams) ProtoMessage

func (*PostValueParams) ProtoMessage()

func (*PostValueParams) ProtoReflect

func (x *PostValueParams) ProtoReflect() protoreflect.Message

func (*PostValueParams) Reset

func (x *PostValueParams) Reset()

func (*PostValueParams) String

func (x *PostValueParams) String() string

type RequestParams

type RequestParams struct {
	Method  *string   `protobuf:"bytes,1,opt,name=method" json:"method,omitempty"`
	Url     *string   `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"`
	Query   *v1.Value `protobuf:"bytes,3,opt,name=query" json:"query,omitempty"`
	Headers *v1.Value `protobuf:"bytes,4,opt,name=headers" json:"headers,omitempty"`
	Body    *v1.Value `protobuf:"bytes,5,opt,name=body" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*RequestParams) Descriptor deprecated

func (*RequestParams) Descriptor() ([]byte, []int)

Deprecated: Use RequestParams.ProtoReflect.Descriptor instead.

func (*RequestParams) GetBody

func (x *RequestParams) GetBody() *v1.Value

func (*RequestParams) GetHeaders

func (x *RequestParams) GetHeaders() *v1.Value

func (*RequestParams) GetMethod

func (x *RequestParams) GetMethod() string

func (*RequestParams) GetQuery

func (x *RequestParams) GetQuery() *v1.Value

func (*RequestParams) GetUrl

func (x *RequestParams) GetUrl() string

func (*RequestParams) ProtoMessage

func (*RequestParams) ProtoMessage()

func (*RequestParams) ProtoReflect

func (x *RequestParams) ProtoReflect() protoreflect.Message

func (*RequestParams) Reset

func (x *RequestParams) Reset()

func (*RequestParams) String

func (x *RequestParams) String() string

Jump to

Keyboard shortcuts

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