Documentation ¶
Index ¶
- Constants
- func CFARun(lg *log.Logger, flowName string, request string) ([]byte, error)
- func IsArray(expr string) bool
- func IsObject(expr string) bool
- func IsTaskTsp(source string) bool
- type Context
- func (c *Context) GetRequest() *fastjson.Value
- func (c *Context) GetValue(source string) ([]*fastjson.Value, error)
- func (c *Context) Init(request string) error
- func (c *Context) MarshalActionRequest(id string) string
- func (c *Context) MarshalActionResponse(id string) string
- func (c *Context) MarshalResponse() ([]byte, error)
- func (c *Context) NewTaskResult(id string)
- func (c *Context) SetCmdDir(dir string)
- func (c *Context) SetHeaders(id string, headers http.Header) error
- func (c *Context) SetResponse(v []*fastjson.Value)
- func (c *Context) SetRsp(id string, rsp []byte) error
- func (c *Context) SetValue(dst string, v []*fastjson.Value) error
- type DataBuilder
- type End
- type Expr
- type Flow
- type HttpRequest
- type Node
- type ParamNode
- type Request
- type RunNode
- type Start
- type Task
- type TaskParam
- type TaskResult
- type YtbDownloader
- type YtbParams
Constants ¶
View Source
const ( GATEWAY = "gateway" START = "start" END = "end" TASK = "task" )
View Source
const ( HTTPREQUEST = "HttpRequest" DATABUILDER = "DataBuilder" YTBDOWNLOADER = "YtbDownloader" )
View Source
const ( ExprTypeHead = iota ExprTypeObject ExprTypeArray )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶ added in v0.1.0
type Context struct { Logger *log.Logger A *fastjson.Arena // flow process result Exit bool CmdDir string // contains filtered or unexported fields }
func (*Context) GetRequest ¶ added in v0.1.0
func (*Context) MarshalActionRequest ¶ added in v0.1.0
func (*Context) MarshalActionResponse ¶ added in v0.1.0
func (*Context) MarshalResponse ¶ added in v0.1.0
func (*Context) NewTaskResult ¶ added in v0.1.0
func (*Context) SetHeaders ¶ added in v0.1.0
func (*Context) SetResponse ¶ added in v0.1.0
type DataBuilder ¶
type DataBuilder struct {
// contains filtered or unexported fields
}
func (*DataBuilder) DoTask ¶
func (t *DataBuilder) DoTask(ctx *Context) error
type Expr ¶ added in v0.1.0
type Expr struct { Type int // Object Array Token string // contains filtered or unexported fields }
func ExpressionParse ¶ added in v0.1.0
func (*Expr) IsActionRequest ¶ added in v0.1.0
func (*Expr) IsResponse ¶ added in v0.1.0
type HttpRequest ¶
type HttpRequest struct {
// contains filtered or unexported fields
}
func (*HttpRequest) DoTask ¶
func (t *HttpRequest) DoTask(ctx *Context) error
type ParamNode ¶
type ParamNode struct { Data string `json:"data"` Type string `json:"type"` // string, number, bool, array Action string `json:"action"` // data parse method, expr, data, iNfunc TargetIdx map[string]string `json:"target_idx"` // to replace target dst item SourceIdx map[string]string `json:"source_idx"` // to replace source dst item }
type Request ¶ added in v0.1.0
type Request struct { Post interface{} `json:"post"` Get map[string]interface{} `json:"get"` }
type TaskResult ¶ added in v0.1.0
type TaskResult struct {
// contains filtered or unexported fields
}
type YtbDownloader ¶ added in v0.1.0
type YtbDownloader struct {
// contains filtered or unexported fields
}
func (*YtbDownloader) DoTask ¶ added in v0.1.0
func (t *YtbDownloader) DoTask(ctx *Context) error
Click to show internal directories.
Click to hide internal directories.