web

package
v0.0.0-...-73d1187 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataResponse

type DataResponse struct {
	Success bool `json:"success"`
	Data    any  `json:"data"`
}

func NewSuccessDataResponse

func NewSuccessDataResponse(data any) DataResponse

type DataResponseNode

type DataResponseNode struct{}

func (DataResponseNode) Run

func (DataResponseNode) Run(ctx nodes.WorkflowContext, input any) (any, error)

type ErrorResponse

type ErrorResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
}

func NewErrorResponse

func NewErrorResponse(err string) ErrorResponse

type Handler

type Handler struct {
	Workflow nodes.Workflow
}

func NewHandler

func NewHandler(w nodes.Workflow) Handler

func (Handler) Serve

func (h Handler) Serve(w http.ResponseWriter, req *http.Request, params httprouter.Params)

type JSONBodyParserNode

type JSONBodyParserNode[Model any] struct{}

func (JSONBodyParserNode[Model]) Run

func (JSONBodyParserNode[Model]) Run(ctx nodes.WorkflowContext, input any) (any, error)

Jump to

Keyboard shortcuts

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