components

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package components contains additional components which can be mounted in a fire application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetServer

type AssetServer struct {
	// contains filtered or unexported fields
}

The AssetServer component server an asset directory on a specified path and may optionally server the index file for not found paths which is needed to run single page applications like Ember.

func DefaultAssetServer

func DefaultAssetServer(directory string) *AssetServer

DefaultAssetServer will create and return an AssetServer that is mounted on the root of the application with enabled SPA mode.

func NewAssetServer

func NewAssetServer(path, directory string, spaMode bool) *AssetServer

NewAssetServer creates and returns a new AssetServer.

func (*AssetServer) Describe

func (s *AssetServer) Describe() fire.ComponentInfo

Describe implements the fire.Component interface.

func (*AssetServer) Register

func (s *AssetServer) Register(router *echo.Echo)

Register implements the fire.RoutableComponent interface.

type Protector

type Protector struct {
	// RequestBodyLimit defines the maximum size of a request body in the form
	// of 4K, 2M, 1G or 1P.
	RequestBodyLimit string

	// AllowMethodOverriding will allow the usage of the X-HTTP-Method-Override
	// header to set a request method when using the POST method.
	AllowMethodOverriding bool

	// AllowedCORSOrigins specifies the allowed origins when CORS.
	AllowedCORSOrigins []string

	// AllowedCORSHeaders specifies the allowed headers when CORS.
	AllowedCORSHeaders []string

	// AllowedCORSMethods specifies the allowed methods when CORS.
	AllowedCORSMethods []string
}

A Protector is a component that can be mounted in an application to enforce common security concerns.

func DefaultProtector

func DefaultProtector() *Protector

DefaultProtector returns a protector that is tailored to be used for JSON APIs.

func (*Protector) Describe

func (p *Protector) Describe() fire.ComponentInfo

Describe implements the fire.Component interface.

func (*Protector) Register

func (p *Protector) Register(router *echo.Echo)

Register implements the fire.RoutableComponent interface.

Jump to

Keyboard shortcuts

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