Documentation ¶
Index ¶
- type CurlArgs
- type FreepsHttpListener
- type HTTPConfig
- type OpCurl
- func (o *OpCurl) Get(ctx *base.Context, mainInput *base.OperatorIO, args CurlArgs) *base.OperatorIO
- func (o *OpCurl) GetDefaultConfig() interface{}
- func (o *OpCurl) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)
- func (o *OpCurl) Post(ctx *base.Context, mainInput *base.OperatorIO, args CurlArgs) *base.OperatorIO
- func (o *OpCurl) PostForm(ctx *base.Context, mainInput *base.OperatorIO, args CurlArgs, ...) *base.OperatorIO
- func (o *OpCurl) Shutdown(ctx *base.Context)
- func (o *OpCurl) StartListening(ctx *base.Context)
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 NewFreepsHttp ¶
func NewFreepsHttp(cfg HTTPConfig, ge *freepsgraph.GraphEngine) *FreepsHttpListener
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) StartListening ¶
StartListening starts the http server