rest

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNode

func NewNode(flowOpCtx *model.FlowOperationalContext, meta model.MetaNode, ctx *model.Context) model.Node

Types

type AuthResponse

type AuthResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int64  `json:"expires_in"`
}
type Header struct {
	Name  string
	Value string
}

type Node

type Node struct {
	base.BaseNode
	// contains filtered or unexported fields
}

Node

func (*Node) Authenticate

func (node *Node) Authenticate(username string, password string)

func (*Node) LoadNodeConfig

func (node *Node) LoadNodeConfig() error

func (*Node) OnInput

func (node *Node) OnInput(msg *model.Message) ([]model.NodeID, error)

func (*Node) WaitForEvent

func (node *Node) WaitForEvent(responseChannel chan model.ReactorEvent)

type NodeConfig

type NodeConfig struct {
	Url                  string
	Method               string // GET,POST,PUT,DELETE, etc.
	TemplateVariableName string
	IsVariableGlobal     bool
	RequestPayloadType   string // json,xml,string
	RequestTemplate      string
	Headers              []Header
	HeadersVariableName  string // header variable should be of type map_str
	ResponseMapping      []ResponseToVariableMap
	LogResponse          bool
	Auth                 OAuth
}

type OAuth

type OAuth struct {
	Enabled      bool
	GrantType    string
	Url          string
	ClientID     string
	ClientSecret string
	Scope        string
	Username     string
	Password     string
}

type ResponseToVariableMap

type ResponseToVariableMap struct {
	Name                 string
	Path                 string
	PathType             string // xml , json
	TargetVariableName   string
	IsVariableGlobal     bool
	TargetVariableType   string
	UpdateTriggerMessage bool
}

type RestActionNodeTemplateParams

type RestActionNodeTemplateParams struct {
	Variable interface{}
	Token    string
	Message  *model.Message
}

Jump to

Keyboard shortcuts

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