freepshttp

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurlArgs

type CurlArgs struct {
	URL         string  `json:"url"`
	Body        *string `json:"body"`
	ContentType *string `json:"content-type"`
	OutputFile  *string `json:"file"`
}

CurlArgs are the common arguments for all curl functions

type FreepsHttpListener

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

func (*FreepsHttpListener) ParseRequest

func (r *FreepsHttpListener) ParseRequest(req *http.Request) (mainArgs map[string]string, mainInput *base.OperatorIO, err error)

func (*FreepsHttpListener) ServeHTTP

func (r *FreepsHttpListener) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*FreepsHttpListener) Shutdown

func (r *FreepsHttpListener) Shutdown(ctx context.Context)

type HTTPConfig

type HTTPConfig struct {
	// Port is the port to listen on
	Port int `json:"port"`
	// enablePprof enables pprof on the given port
	EnablePprof bool `json:"enablePprof"`
	// Graph processing timeout in seconds
	GraphProcessingTimeout int `json:"graphProcessingTimeout"`
}

HTTPConfig is the config for the http connector

type OpCurl

type OpCurl struct {
	CR     *utils.ConfigReader
	GE     *freepsgraph.GraphEngine
	Config HTTPConfig
	// contains filtered or unexported fields
}

func (*OpCurl) Get

func (o *OpCurl) Get(ctx *base.Context, mainInput *base.OperatorIO, args CurlArgs) *base.OperatorIO

Get executes a GET request to the given URL and returns either the response body or information about the downloaded file if an output file is specified

func (*OpCurl) GetDefaultConfig

func (o *OpCurl) GetDefaultConfig() interface{}

GetDefaultConfig returns the default config for the http connector

func (*OpCurl) InitCopyOfOperator

func (o *OpCurl) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)

InitCopyOfOperator creates a copy of the operator

func (*OpCurl) Post

func (o *OpCurl) Post(ctx *base.Context, mainInput *base.OperatorIO, args CurlArgs) *base.OperatorIO

Post executes a POST request to the given URL and returns either the response body or information about the downloaded file if an output file is specified

func (*OpCurl) PostForm

func (o *OpCurl) PostForm(ctx *base.Context, mainInput *base.OperatorIO, args CurlArgs, formFields base.FunctionArguments) *base.OperatorIO

PostForm executes a POST request to the given URL with the given form fields and returns either the response body or information about the downloaded file if an output file is specified

func (*OpCurl) Shutdown

func (o *OpCurl) Shutdown(ctx *base.Context)

Shutdown shuts down the http server

func (*OpCurl) StartListening

func (o *OpCurl) StartListening(ctx *base.Context)

StartListening starts the http server

Jump to

Keyboard shortcuts

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