server

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName string = "http_server"
	ResponsePort         = "response"
	RequestPort          = "request"
	StartPort            = "start"
	StopPort             = "stop"
	StatusPort           = "status"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

func (*Component) GetInfo

func (h *Component) GetInfo() module.ComponentInfo

func (*Component) Handle

func (h *Component) Handle(ctx context.Context, handler module.Handler, port string, msg interface{}) error

func (*Component) Instance

func (h *Component) Instance() module.Component

func (*Component) Ports

func (h *Component) Ports() []module.Port

type Control added in v0.1.37

type Control struct {
	Status     string   `json:"status" title:"Status" readonly:"true"`
	ListenAddr []string `json:"listenAddr" title:"Listen Address" readonly:"true"`
}

type Request

type Request struct {
	Context       StartContext `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       []etc.Header `json:"headers,omitempty"`
	Body          string       `json:"body"`
	Scheme        string       `json:"scheme"`
}

type Response

type Response struct {
	RequestID   string          `` /* 143-byte string literal not displayed */
	StatusCode  int             `` /* 139-byte string literal not displayed */
	ContentType etc.ContentType `json:"contentType" required:"true"`
	Headers     []etc.Header    `json:"headers,omitempty"  title:"Response headers"`
	Body        string          `json:"body" title:"Response body" format:"textarea"`
}

type Settings

type Settings 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 server"`
}

type Start

type Start struct {
	Context      StartContext `json:"context,omitempty" configurable:"true" title:"Context" description:"Start context"`
	AutoHostName bool         `json:"autoHostName" title:"Automatically generate hostname" description:"Use cluster auto subdomain setup if any."`
	Hostnames    []string     `json:"hostnames,omitempty" title:"Hostnames"  description:"List of virtual host this server should be bound to."` //requiredWhen:"['kind', 'equal', 'enum 1']"
	ReadTimeout  int          ``                                                                                                                 /* 215-byte string literal not displayed */
	WriteTimeout int          ``                                                                                                                 /* 204-byte string literal not displayed */
}

type StartContext

type StartContext any

type Status

type Status struct {
	Context    StartContext `json:"context" title:"Context"`
	ListenAddr []string     `json:"listenAddr" title:"Listen Address"`
	IsRunning  bool         `json:"isRunning" title:"Is running"`
}

type Stop

type Stop struct {
}

Jump to

Keyboard shortcuts

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