http

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package http implements http interface for Stee. It is in charge of handling HTTP server(s) and handling of clients HTTP requests on them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableAPI

func EnableAPI(enable bool, prefix string) handleRootOption

EnableAPI is an option for HandleRoot(). It enables the API.

It should only be used as an argument for HandleRoot(), hence the unexported return type.

func EnableSimpleAPI

func EnableSimpleAPI(enable bool) handleRootOption

EnableSimpleAPI is an option for HandleRoot(). It enables the simple API.

It should only be used as an argument for HandleRoot(), hence the unexported return type.

func EnableUI

func EnableUI(enable bool, prefix string) handleRootOption

EnableUI is an option for HandleRoot(). It enables the UI.

It should only be used as an argument for HandleRoot(), hence the unexported return type.

func HandleRoot

func HandleRoot(core *stee.Core, options ...handleRootOption) http.Handler

HandleRoot returns a http.Handler in charge of dispatching requests to the appropriate "sub"-handler

func NewServer

func NewServer(cfg ServerConfig) *http.Server

NewServer returns a http.Server

Types

type ServerConfig

type ServerConfig struct {
	ListenAddress string
	Handler       http.Handler
}

ServerConfig is the configuration to provide to create an http.Server with NewServer()

Jump to

Keyboard shortcuts

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