module

package
v0.0.0-...-99214e8 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Title       string `json:"title"`
	Author      string `json:"author"`
	Description string `json:"description"`
	Sign        string `json:"-"`

	Req  *Request  `json:"request"`
	Resp *Response `json:"response"`

	Env *cel.Env `json:"-"`
}

Body is the module body.

func (*Body) DoRequest

func (b *Body) DoRequest(req *http.Request, body []byte)

DoRequest modify the request if the module was invoked.

func (*Body) DoResponse

func (b *Body) DoResponse(resp *http.Response, body []byte)

func (*Body) Init

func (b *Body) Init() error

func (*Body) Scan

func (b *Body) Scan(value interface{}) error

func (*Body) Value

func (b *Body) Value() (driver.Value, error)

type Request

type Request struct {
	On    string      `json:"on"`
	OnPrg cel.Program `json:"-"`

	Transmit    string                 `json:"transmit"`
	TransmitURL *url.URL               `json:"-"`
	Header      map[string]string      `json:"header"`
	Body        map[string]interface{} `json:"-"` //FIXME
}

type Response

type Response struct {
	On    string      `json:"on"`
	OnPrg cel.Program `json:"-"`

	StatusCode int                    `json:"status_code"`
	Header     map[string]string      `json:"header"`
	Body       map[string]interface{} `json:"body"` //FIXME
}

Jump to

Keyboard shortcuts

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