httpserver

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Overview

The `httpserver` task implements a server which can serve requests over HTTP, HTTPS and FCGI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWithPlugin

func NewWithPlugin(p Plugin, router plugin.Router) (*httpserver, error)

Create a new logger task with provider of other tasks

Types

type Plugin

type Plugin struct {
	task.Plugin
	Listen_  types.String   `json:"listen,omitempty"`  // Address or path for binding HTTP server
	TLS_     *TLS           `json:"tls,omitempty"`     // TLS parameters, or nil if not using TLS (ignored for file sockets)
	Timeout_ types.Duration `json:"timeout,omitempty"` // Read timeout on HTTP requests (ignored for file sockets)
	Owner_   types.String   `json:"owner,omitempty"`   // Owner of the socket file (ignored for network sockets)
	Group_   types.String   `json:"group,omitempty"`   // Owner Group of the socket file (ignored for network sockets)
	Router_  types.Task     `json:"router,omitempty"`  // The router object which serves the gateways, optional.
	Routes   []router.Route `json:"routes"`            // Array of routes, required
}

func WithLabel added in v1.1.3

func WithLabel(label string) Plugin

func (Plugin) Group added in v1.1.1

func (p Plugin) Group() (int, error)

func (Plugin) Listen

func (p Plugin) Listen() string

func (Plugin) Mode added in v1.1.1

func (p Plugin) Mode() os.FileMode

func (Plugin) Name

func (p Plugin) Name() string

func (Plugin) New

func (p Plugin) New(ctx context.Context, provider iface.Provider) (iface.Task, error)

Create a new logger task with provider of other tasks

func (Plugin) Owner added in v1.1.1

func (p Plugin) Owner() (int, error)

func (Plugin) Router

func (p Plugin) Router(ctx context.Context, provider iface.Provider) (plugin.Router, error)

func (Plugin) TLS

func (p Plugin) TLS() (*tls.Config, error)

func (Plugin) Timeout

func (p Plugin) Timeout() time.Duration

func (Plugin) WithListen added in v1.1.3

func (p Plugin) WithListen(listen string) Plugin

type TLS

type TLS struct {
	Key_  types.String `json:"key"`  // Path to TLS Private Key
	Cert_ types.String `json:"cert"` // Path to TLS Certificate
}

Directories

Path Synopsis
Package fcgi implements the FastCGI protocol.
Package fcgi implements the FastCGI protocol.
router package implements a http.Handler and the ability to register routes on a gateway
router package implements a http.Handler and the ability to register routes on a gateway
static package implements a http.Handler for serving static files
static package implements a http.Handler for serving static files
tokenauth package implements authentication tokens for HTTP servers
tokenauth package implements authentication tokens for HTTP servers
The `util` package provides utility methods for decoding request parameters and bodies, and providing responses over HTTP
The `util` package provides utility methods for decoding request parameters and bodies, and providing responses over HTTP

Jump to

Keyboard shortcuts

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