Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (this *Client) Address() (string, error)
- func (this *Client) ApplyToMap(prefix string, to *map[string]interface{})
- func (this *Client) AsMap() map[string]interface{}
- func (this Client) Host() string
- func (this *Client) Origin() (*url.URL, error)
- func (this *Client) RequestedUrl() (*url.URL, error)
- type Context
- func (this *Context) AsMap(inlineFields bool) map[string]interface{}
- func (this *Context) Done(result Result, err ...error)
- func (this *Context) Log() log.Logger
- func (this *Context) LogProvider() func() log.Logger
- func (this *Context) MarkError(err error)
- func (this *Context) MarkUnavailable(err error)
- func (this *Context) MarkUnknown()
- func (this *Context) MarshalJSON() ([]byte, error)
- func (this *Context) NewGenericResponse(statusCode int, message string) *GenericResponse
- func (this *Context) Release() error
- type GenericResponse
- type Id
- type MetricsCollector
- type RedirectResult
- type Result
- type ResultHandler
- type SimpleResult
- type Stage
- type Upstream
Constants ¶
View Source
const ( FieldClientMethod = "method" FieldClientProto = "proto" FieldClientUserAgent = "userAgent" FieldClientUrl = "url" FieldClientAddress = "address" FieldClientStatus = "status" FieldClientDuration = "duration" )
View Source
const ( FieldRequestId = "requestId" FieldCorrelationId = "correlationId" FieldClient = "client" FieldUpstream = "upstream" FieldResult = "result" FieldError = "error" )
View Source
const ( FieldUpstreamAddress = "address" FieldUpstreamStatus = "status" FieldUpstreamDuration = "duration" FieldUpstreamUrl = "url" FieldUpstreamMethod = "method" FieldUpstreamProto = "proto" FieldUpstreamSource = "source" FieldUpstreamMatches = "matches" )
Variables ¶
View Source
var (
ErrNoRequestSet = errors.New("no request set")
)
View Source
var (
NilRequestId = Id(uuid.Nil)
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Connector server.ConnectorId FromOtherReverseProxy bool Request *http.Request Response http.ResponseWriter Status int Started time.Time Duration time.Duration // contains filtered or unexported fields }
func (*Client) ApplyToMap ¶ added in v0.3.0
type Context ¶
type Context struct { Settings *settings.Settings Client Client Upstream Upstream Id Id CorrelationId Id Stage Stage Logger log.Logger Rule rules.Rule Result Result Error error Properties map[string]interface{} }
func AcquireContext ¶
func (*Context) LogProvider ¶ added in v0.7.0
func (this *Context) LogProvider() func() log.Logger
func (*Context) MarkUnavailable ¶
func (*Context) MarkUnknown ¶
func (this *Context) MarkUnknown()
func (*Context) MarshalJSON ¶
func (*Context) NewGenericResponse ¶ added in v0.1.12
func (this *Context) NewGenericResponse(statusCode int, message string) *GenericResponse
type GenericResponse ¶ added in v0.1.12
type GenericResponse struct {
// contains filtered or unexported fields
}
func (*GenericResponse) SetData ¶ added in v0.1.12
func (this *GenericResponse) SetData(data interface{}) *GenericResponse
func (*GenericResponse) SetPath ¶ added in v0.1.12
func (this *GenericResponse) SetPath(path string) *GenericResponse
func (*GenericResponse) StreamAsJson ¶ added in v0.1.12
func (this *GenericResponse) StreamAsJson()
func (GenericResponse) StreamAsXml ¶ added in v0.1.12
func (this GenericResponse) StreamAsXml()
func (*GenericResponse) StreamAsYaml ¶ added in v0.1.12
func (this *GenericResponse) StreamAsYaml()
type MetricsCollector ¶ added in v0.1.18
type MetricsCollector interface { CollectContext(*Context) CollectClientStarted(server.ConnectorId) func() CollectUpstreamStarted() func() }
type RedirectResult ¶
func (RedirectResult) Name ¶
func (this RedirectResult) Name() string
func (RedirectResult) Status ¶
func (this RedirectResult) Status() int
func (RedirectResult) String ¶
func (this RedirectResult) String() string
func (RedirectResult) WasResponseSendToClient ¶
func (this RedirectResult) WasResponseSendToClient() bool
type ResultHandler ¶
type ResultHandler func(ctx *Context)
type SimpleResult ¶
type SimpleResult uint8
var ( ResultUnknown SimpleResult = 0 ResultSuccess SimpleResult = 1 ResultOk SimpleResult = 2 ResultFailedWithUnexpectedError SimpleResult = 3 ResultFailedWithRuleNotFound SimpleResult = 4 ResultFailedWithAccessDenied SimpleResult = 6 ResultFallback SimpleResult = 7 ResultFailedWithClientGone SimpleResult = 9 ResultFailedWithIllegalHost SimpleResult = 10 )
func (SimpleResult) Name ¶
func (this SimpleResult) Name() string
func (SimpleResult) Status ¶
func (this SimpleResult) Status() int
func (SimpleResult) String ¶
func (this SimpleResult) String() string
func (SimpleResult) WasResponseSendToClient ¶
func (this SimpleResult) WasResponseSendToClient() bool
Click to show internal directories.
Click to hide internal directories.