middleware

package
v0.0.0-...-edb78a7 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2015 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertifiedConfig

func CertifiedConfig(certs *util.Certified) gin.HandlerFunc

func CrossOrigin

func CrossOrigin() gin.HandlerFunc

func DataBase

func DataBase(db *sql.DB, debug bool) gin.HandlerFunc

func SecurityRest

func SecurityRest() gin.HandlerFunc

func Transaction

func Transaction() gin.HandlerFunc

Types

type ContextWrapper

type ContextWrapper interface {
	Response() Response
	Bind(e interface{})
	GetParam(name string) string
	GetParamAsInt(name string) int
	GetParamAsInt64(name string) int64
	GetQueryParam(name string) string
	GetQueryParamAsInt(name string) int
	GetQueryParamAsInt64(name string) int64
	Paginate(pagina int, limite int, total int64) Params
	GetServiceFactory() service.ServiceFactory
}

type ContextWrapperFactory

type ContextWrapperFactory interface {
	Create(context *gin.Context) ContextWrapper
}

func NewContextWrapperFactory

func NewContextWrapperFactory() ContextWrapperFactory

type Entity

type Entity interface {
	Entity(value interface{})
}
type Header interface {
	Status(code int) Entity
}

type Opcoes

type Opcoes struct {
	AllowedHosts            []string
	SSLRedirect             bool
	SSLTemporaryRedirect    bool
	SSLHost                 string
	SSLProxyHeaders         map[string]string
	STSSeconds              int64
	STSIncludeSubdomains    bool
	FrameDeny               bool
	CustomFrameOptionsValue string
	ContentTypeNosniff      bool
	BrowserXssFilter        bool
	ContentSecurityPolicy   string
	BadHostHandler          http.Handler
}

type Params

type Params map[string]string

type Response

type Response interface {
	Ok(value string)
	Error(status int, value string)
	Created()
	NoContent()
	Status(code int) Entity
	Header(headers Params) Header
}

func NewResponse

func NewResponse(c *gin.Context) Response

Jump to

Keyboard shortcuts

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