helix

package module
v0.0.0-...-77850f7 Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: MIT Imports: 18 Imported by: 1

README

helix

Build Status

Helix - a Solid HTTP/2 server written in Go

Documentation

Overview

Extra middleware

Index

Constants

This section is empty.

Variables

View Source
var (
	HELIX_VERSION = "0.1"
)

Functions

func CORSHandler

func CORSHandler(next echo.HandlerFunc) echo.HandlerFunc

func DeleteHandler

func DeleteHandler(c echo.Context) error

func ETagMatch

func ETagMatch(header string, etag string) bool

func ETagNoneMatch

func ETagNoneMatch(header string, etag string) bool

func GetCurrentRoot

func GetCurrentRoot() string

func GetHandler

func GetHandler(c echo.Context) error

func HeadHandler

func HeadHandler(c echo.Context) error

func LoggerMiddleware

func LoggerMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func NewServer

func NewServer(conf *HelixConfig) *echo.Echo

NewServer creates a new server handler

func NewTLSConfig

func NewTLSConfig(cert, key string) (*tls.Config, error)

func OptionsHandler

func OptionsHandler(c echo.Context) error

OptionsHandler uses a closure with the signature func(http.ResponseWriter, *http.Request). It sets extra headers that are needed for the CORS preflight requests.

func PatchHandler

func PatchHandler(c echo.Context) error

func PostHandleRDF

func PostHandleRDF(c echo.Context) error

func PostHandler

func PostHandler(c echo.Context) error

func PutHandler

func PutHandler(c echo.Context) error

func ServerHeader

func ServerHeader(next echo.HandlerFunc) echo.HandlerFunc

ServerHeader middleware sets a Server header to the response.

func ServerInfo

func ServerInfo(c echo.Context) error

Types

type HelixConfig

type HelixConfig struct {
	Conf    string
	Port    string
	Debug   bool
	Logfile string
	Root    string
	Cert    string
	Key     string
}

func NewHelixConfig

func NewHelixConfig() *HelixConfig

func (*HelixConfig) GetLogger

func (c *HelixConfig) GetLogger() io.Writer

func (*HelixConfig) LoadJSONFile

func (c *HelixConfig) LoadJSONFile(filename string) error

LoadJSONFile loads server configuration

type Stats

type Stats struct {
	Uptime       time.Time      `json:"uptime"`
	RequestCount uint64         `json:"requestCount"`
	Statuses     map[string]int `json:"statuses"`
	// contains filtered or unexported fields
}

func NewStats

func NewStats() *Stats

func (*Stats) Handler

func (s *Stats) Handler(c echo.Context) error

Handle is the endpoint to get stats.

func (*Stats) StatsMiddleware

func (s *Stats) StatsMiddleware(next echo.HandlerFunc) echo.HandlerFunc

Process is the middleware function.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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