http

package
v0.0.0-...-f6b08e7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultMethod     string = "GET"
	DefaultStatusCode int    = 200
)

Functions

func LaunchService

func LaunchService(defaultServer *server.Client, port string, globalVars map[string]string, config ServerConfig)

LaunchService

Types

type HTTPHandler

type HTTPHandler struct {
	Method   string            `yaml:"method,omitempty"`
	Body     string            `yaml:"body,omitempty"`
	BodyFile string            `yaml:"body_file,omitempty"`
	Code     int               `yaml:"code,omitempty"`
	Headers  map[string]string `yaml:"headers,omitempty"`
	Handler  *Handler          `yaml:"handler,omitempty"` // Should be removed if not used
}

HTTPHandler

type Handler

type Handler struct {
	Type         string `yaml:"type"`
	Template     string `yaml:"template"`
	TemplateFile string `yaml:"template_file"`
}

Handler

type ServerConfig

type ServerConfig struct {
	Routes map[string]HTTPHandler
}

ServerConfig

Jump to

Keyboard shortcuts

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