failover

package
v0.0.0-...-a5469ec Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2015 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package failover contains predicates that define when request should be retried.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNetworkError

func IsNetworkError(req request.Request) bool

Failover in case if last attempt resulted in error

Types

type Predicate

type Predicate func(request.Request) bool

Predicate that defines what request can fail over in case of error or http response

func And

func And(fns ...Predicate) Predicate

Function that returns predicate by joining the passed predicates with AND

func AttemptsLe

func AttemptsLe(count int) Predicate

Function that returns predicate allowing certain number of attempts

func Or

func Or(fns ...Predicate) Predicate

Function that returns predicate by joining the passed predicates with OR

func ParseExpression

func ParseExpression(in string) (Predicate, error)

Parses expression in the go language into Failover predicates

func RequestMethodEq

func RequestMethodEq(method string) Predicate

func ResponseCodeEq

func ResponseCodeEq(code int) Predicate

Function that returns predicate triggering failover in case if proxy returned certain http code

Jump to

Keyboard shortcuts

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