armor

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 4 Imported by: 0

README

Armor License Build Status Twitter

What can it do today?

  • Serve HTTP/2
  • Automatically install TLS certificates from https://letsencrypt.org
  • Proxy HTTP and WebSocket requests
  • Define virtual hosts with path level routing
  • Graceful shutdown
  • Limit request body
  • Serve static files
  • Log requests
  • Gzip response
  • Cross-origin Resource Sharing (CORS)
  • Security
    • XSSProtection
    • ContentTypeNosniff
    • ContentSecurityPolicy
    • HTTP Strict Transport Security (HSTS)
  • Add / Remove trailing slash from the URL with option to redirect
  • Redirect requests
  • http to https
  • http to https www
  • http to https non www
  • non www to www
  • www to non www

Most of the functionality is implemented via Plugin interface which makes writing a custom plugin super easy.

Get Started

What's on the roadmap?

  • Website
  • Code coverage
  • Test cases

Documentation

Index

Constants

View Source
const (
	Version = "0.3.0"
	Website = "https://armor.labstack.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Armor

type Armor struct {
	Address      string           `yaml:"address"`
	TLS          *TLS             `yaml:"tls"`
	ReadTimeout  time.Duration    `yaml:"read_timeout"`
	WriteTimeout time.Duration    `yaml:"write_timeout"`
	Plugins      []Plugin         `yaml:"plugins"`
	Hosts        map[string]*Host `yaml:"hosts"`
	Logger       *log.Logger      `yaml:"-"`
	Colorer      *color.Color     `yaml:"-"`
}

type Host

type Host struct {
	Name     string           `yaml:"-"`
	CertFile string           `yaml:"cert_file"`
	KeyFile  string           `yaml:"key_file"`
	Plugins  []Plugin         `yaml:"plugins"`
	Paths    map[string]*Path `yaml:"paths"`
	Echo     *echo.Echo       `yaml:"-"`
}

type Path

type Path struct {
	Plugins []Plugin `yaml:"plugins"`
}

type Plugin added in v0.2.1

type Plugin map[string]interface{}

type TLS

type TLS struct {
	Address  string `yaml:"address"`
	CertFile string `yaml:"cert_file"`
	KeyFile  string `yaml:"key_file"`
	Auto     bool   `yaml:"auto"`
	CacheDir string `yaml:"cache_dir"`
}

Directories

Path Synopsis
cmd
package plugin is a generated protocol buffer package.
package plugin is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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