interceptor

package
v0.0.0-...-73d3301 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

interceptor add steps to the REST request before calling the handler

Index

Constants

This section is empty.

Variables

View Source
var (
	ACL []*net.IPNet
)
View Source
var (
	ErrSecretNotFound = errors.New("Secret related to Authorization's secret id not found")
)

List of possible errors that can occur when calling functions from this file. Other erros can also occurs from low level layers

Functions

func CheckHTTPCache

func CheckHTTPCache(w http.ResponseWriter, r *http.Request, handler HTTPCacheHandler)

Types

type CodecHandler

type CodecHandler interface {
	GetLanguage() *messages.LanguagePack
	MessageResponse(string, string) error
}

type Database

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

func NewDatabase

func NewDatabase(h DatabaseHandler) *Database

func (*Database) After

func (i *Database) After(w http.ResponseWriter, r *http.Request)

func (*Database) Before

func (i *Database) Before(w http.ResponseWriter, r *http.Request)

type DatabaseHandler

type DatabaseHandler interface {
	SetDatabaseSession(*mgo.Session)
	GetDatabaseSession() *mgo.Session
	SetDatabase(*mgo.Database)
	GetDatabase() *mgo.Database
}

type Domain

type Domain struct {
	interceptor.NoAfterInterceptor
	// contains filtered or unexported fields
}

func NewDomain

func NewDomain(h DomainHandler) *Domain

func (*Domain) Before

func (i *Domain) Before(w http.ResponseWriter, r *http.Request)

type DomainHandler

type DomainHandler interface {
	DatabaseHandler
	GetFQDN() string
	SetDomain(domain model.Domain)
}

type FQDN

type FQDN struct {
	interceptor.NoAfterInterceptor
	// contains filtered or unexported fields
}

func NewFQDN

func NewFQDN(h FQDNHandler) *FQDN

func (*FQDN) Before

func (i *FQDN) Before(w http.ResponseWriter, r *http.Request)

type FQDNHandler

type FQDNHandler interface {
	SetFQDN(fqdn string)
	GetFQDN() string
	MessageResponse(string, string) error
}

type HTTPCacheAfter

type HTTPCacheAfter struct {
	interceptor.NoBeforeInterceptor
	// contains filtered or unexported fields
}

func NewHTTPCacheAfter

func NewHTTPCacheAfter(h HTTPCacheHandler) *HTTPCacheAfter

func (*HTTPCacheAfter) After

func (i *HTTPCacheAfter) After(w http.ResponseWriter, r *http.Request)

type HTTPCacheBefore

type HTTPCacheBefore struct {
	interceptor.NoAfterInterceptor
	// contains filtered or unexported fields
}

func NewHTTPCacheBefore

func NewHTTPCacheBefore(h HTTPCacheHandler) *HTTPCacheBefore

func (*HTTPCacheBefore) Before

func (i *HTTPCacheBefore) Before(w http.ResponseWriter, r *http.Request)

type HTTPCacheHandler

type HTTPCacheHandler interface {
	GetLastModifiedAt() time.Time
	GetETag() string
	MessageResponse(string, string) error
	ClearResponse()
}

type JSONCodec

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

func NewJSONCodec

func NewJSONCodec(h CodecHandler) *JSONCodec

func (*JSONCodec) After

func (c *JSONCodec) After(w http.ResponseWriter, r *http.Request)

func (*JSONCodec) Before

func (c *JSONCodec) Before(w http.ResponseWriter, r *http.Request)

type Permission

type Permission struct {
	interceptor.NoAfterInterceptor
}

func (*Permission) Before

func (i *Permission) Before(w http.ResponseWriter, r *http.Request)

Permission is responsable for checking if the user is allowed to send requests to the REST server

type Scan

type Scan struct {
	interceptor.NoAfterInterceptor
	// contains filtered or unexported fields
}

func NewScan

func NewScan(h ScanHandler) *Scan

func (*Scan) Before

func (i *Scan) Before(w http.ResponseWriter, r *http.Request)

type ScanHandler

type ScanHandler interface {
	DatabaseHandler
	GetStartedAt() string
	SetScan(scan model.Scan)
	MessageResponse(string, string) error
}

type Validator

type Validator struct {
	interceptor.NoAfterInterceptor
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(h ValidatorHandler) *Validator

func (*Validator) Before

func (i *Validator) Before(w http.ResponseWriter, r *http.Request)

Verify HTTP headers and fill context with user preferences

type ValidatorHandler

type ValidatorHandler interface {
	SetLanguage(*messages.LanguagePack)
	MessageResponse(string, string) error
}

Jump to

Keyboard shortcuts

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