Documentation ¶
Index ¶
- Constants
- type Client
- type ClientError
- type ClientRequest
- type ClientRequestBody
- type ClientRequestContext
- type ClientRequestSettings
- type ClientResponse
- type ContentType
- type Header
- type Response
- type Server
- type ServerRequest
- type ServerResponse
- type ServerResponseBody
- type ServerSettings
- type ServerStart
- type ServerStartContext
- type ServerStartControl
- type ServerStatus
- type ServerStop
- type ServerStopControl
Constants ¶
View Source
const ( ClientComponent = "http_client" ClientRequestPort = "request" ClientResponsePort = "response" ClientErrorPort = "error" )
View Source
const ( HeaderContentType = "Content-Type" MIMEApplicationJSON = "application/json" MIMEApplicationXML = "application/xml" MIMETextXML = "text/xml" MimeTextPlain = "text/plain" MIMETextHTML = "text/html" MIMEApplicationForm = "application/x-www-form-urlencoded" MIMEMultipartForm = "multipart/form-data" )
View Source
const ( ServerComponent string = "http_server" ServerResponsePort = "response" ServerRequestPort = "request" ServerStartPort = "start" ServerStopPort = "stop" ServerStatusPort = "status" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) GetInfo ¶
func (h Client) GetInfo() module.ComponentInfo
type ClientError ¶
type ClientError struct { Request ClientRequest `json:"request"` Error string `json:"response"` }
type ClientRequest ¶
type ClientRequest struct { Context ClientRequestContext `json:"context" configurable:"true" title:"Context" description:"Message to be sent further" propertyOrder:"1"` Method string `` /* 155-byte string literal not displayed */ URL string `json:"url" required:"true" title:"URL" format:"uri" propertyOrder:"3"` Headers []Header `json:"headers" required:"true" title:"Headers" propertyOrder:"4"` Body ClientRequestBody `json:"body" configurable:"true" title:"Request Body" propertyOrder:"5"` }
type ClientRequestBody ¶ added in v0.1.5
type ClientRequestBody any
type ClientRequestContext ¶
type ClientRequestContext any
type ClientRequestSettings ¶
type ClientRequestSettings struct {
EnableErrorPort bool `` /* 137-byte string literal not displayed */
}
type ClientResponse ¶
type ClientResponse struct { Request ClientRequest `json:"request"` Response string `json:"response"` }
type ContentType ¶
type ContentType string
func (ContentType) JSONSchema ¶
func (c ContentType) JSONSchema() (jsonschema.Schema, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetInfo ¶
func (h *Server) GetInfo() module.ComponentInfo
type ServerRequest ¶
type ServerRequest struct { Context ServerStartContext `json:"context"` RequestID string `json:"requestID" required:"true"` RequestURI string `json:"requestURI" required:"true"` RequestParams url.Values `json:"requestParams" required:"true"` Host string `json:"host" required:"true"` Method string `json:"method" required:"true" title:"Method" enum:"GET,POST,PATCH,PUT,DELETE" enumTitles:"GET,POST,PATCH,PUT,DELETE"` RealIP string `json:"realIP"` Headers []Header `json:"headers,omitempty"` Body any `json:"body"` Scheme string `json:"scheme"` }
type ServerResponse ¶
type ServerResponse struct { RequestID string `` /* 161-byte string literal not displayed */ StatusCode int `` /* 157-byte string literal not displayed */ ContentType ContentType `json:"contentType" required:"true" propertyOrder:"3"` Headers []Header `json:"headers" title:"Response headers" propertyOrder:"4"` Body ServerResponseBody `json:"body" title:"Response body" configurable:"true" propertyOrder:"5"` }
type ServerResponseBody ¶
type ServerResponseBody any
type ServerSettings ¶
type ServerSettings struct { EnableStatusPort bool `` /* 127-byte string literal not displayed */ EnableStopPort bool `json:"enableStopPort" required:"true" title:"Enable stop port" description:"Stop port allows you to stop the server"` EnableStartPort bool `json:"enableStartPort" required:"true" title:"Enable start port" description:"Start port allows you to start the server"` }
type ServerStart ¶
type ServerStart struct { Context ServerStartContext `json:"context" configurable:"true" title:"Context" description:"Start context" propertyOrder:"1"` AutoHostName bool `` /* 132-byte string literal not displayed */ Hostnames []string `` //requiredWhen:"['kind', 'equal', 'enum 1']" /* 136-byte string literal not displayed */ ReadTimeout int `` /* 233-byte string literal not displayed */ WriteTimeout int `` /* 222-byte string literal not displayed */ }
type ServerStartContext ¶
type ServerStartContext any
type ServerStartControl ¶
type ServerStatus ¶
type ServerStatus struct { Context ServerStartContext `json:"context" title:"Context" propertyOrder:"1"` ListenAddr []string `json:"listenAddr" title:"Listen Address" readonly:"true" propertyOrder:"2"` IsRunning bool `json:"isRunning" title:"Is running" readonly:"true" propertyOrder:"3"` }
type ServerStop ¶
type ServerStop struct { }
type ServerStopControl ¶
type ServerStopControl struct { Stop bool `json:"stop" format:"button" title:"Stop" required:"true" description:"Stop HTTP server" propertyOrder:"1"` Status string `json:"status" title:"Status" readonly:"true" propertyOrder:"2"` ListenAddr []string `json:"listenAddr" title:"Listen Address" readonly:"true" propertyOrder:"3"` }
Click to show internal directories.
Click to hide internal directories.