go-agent: github.com/sqreen/go-agent/agent/internal/rule/callback Index | Files

package callback

import "github.com/sqreen/go-agent/agent/internal/rule/callback"

Index

Package Files

add-security-headers.go monitor-http-status-code.go types.go write-custom-error-page.go write-http-redirection.go

func NewAddSecurityHeadersCallbacks Uses

func NewAddSecurityHeadersCallbacks(rule Context, nextProlog sqhook.PrologCallback) (prolog sqhook.PrologCallback, err error)

NewAddSecurityHeadersCallbacks returns the native prolog and epilog callbacks to be hooked to `sqhttp.MiddlewareWithError` in order to add HTTP headers provided by the rule's data.

func NewMonitorHTTPStatusCodeCallbacks Uses

func NewMonitorHTTPStatusCodeCallbacks(rule Context, nextProlog sqhook.PrologCallback) (prolog sqhook.PrologCallback, err error)

func NewWriteCustomErrorPageCallbacks Uses

func NewWriteCustomErrorPageCallbacks(rule Context, nextProlog sqhook.PrologCallback) (prolog sqhook.PrologCallback, err error)

NewWriteCustomErrorPageCallbacks returns the native prolog and epilog callbacks modifying the arguments of `httphandler.WriteResponse` in order to modify the http status code and error page that are provided by the rule's data.

func NewWriteHTTPRedirectionCallbacks Uses

func NewWriteHTTPRedirectionCallbacks(rule Context, nextProlog sqhook.PrologCallback) (prolog sqhook.PrologCallback, err error)

NewWriteHTTPRedirectionCallbacks returns the native prolog and epilog callbacks modifying the arguments of `httphandler.WriteResponse` in order to modify the http status code and headers in order to perform an HTTP redirection to the URL provided by the rule's data.

type AddSecurityHeadersEpilogCallbackType Uses

type AddSecurityHeadersEpilogCallbackType = func(*error)

type AddSecurityHeadersPrologCallbackType Uses

type AddSecurityHeadersPrologCallbackType = func(*http.ResponseWriter) (AddSecurityHeadersEpilogCallbackType, error)

type Context Uses

type Context interface {
    // Get the rule configuration.
    Config() interface{}
    // Push a new metrics value for the given key into the default metrics store
    // given by the rule.
    PushMetricsValue(key interface{}, value uint64)
}

type MonitorHTTPStatusCodeEpilogCallbackType Uses

type MonitorHTTPStatusCodeEpilogCallbackType = func()

type MonitorHTTPStatusCodePrologCallbackType Uses

type MonitorHTTPStatusCodePrologCallbackType = func(sqhook.MethodReceiver, *int) (MonitorHTTPStatusCodeEpilogCallbackType, error)

type WriteCustomErrorPageEpilogCallbackType Uses

type WriteCustomErrorPageEpilogCallbackType = func()

type WriteCustomErrorPagePrologCallbackType Uses

type WriteCustomErrorPagePrologCallbackType = func(*http.ResponseWriter, **http.Request, *http.Header, *int, *[]byte) (WriteCustomErrorPageEpilogCallbackType, error)

type WriteHTTPRedirectionEpilogCallbackType Uses

type WriteHTTPRedirectionEpilogCallbackType = func()

type WriteHTTPRedirectionPrologCallbackType Uses

type WriteHTTPRedirectionPrologCallbackType = func(*http.ResponseWriter, **http.Request, *http.Header, *int, *[]byte) (WriteHTTPRedirectionEpilogCallbackType, error)

Package callback imports 5 packages (graph) and is imported by 1 packages. Updated 2019-08-13. Refresh now. Tools for package owners.