circuitbreaker

package
v0.0.0-...-f616806 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *http.Client

Client to do http requests with

Functions

func CallUsingCircuitBreaker

func CallUsingCircuitBreaker(ctx context.Context, breakerName string, url string, method string) ([]byte, error)

CallUsingCircuitBreaker performs a HTTP call inside a circuit breaker.

func ConfigureHystrix

func ConfigureHystrix(commands []string, amqpClient rabbitmq.IRabbitMQMessagingClient)

ConfigureHystrix sets up hystrix circuit breakers.

func Deregister

func Deregister(amqpClient messaging.IMessagingClient)

Deregister publishes a Deregister token to Hystrix/Turbine

func PerformHTTPRequestCircuitBreaker

func PerformHTTPRequestCircuitBreaker(ctx context.Context, breakerName string, req *http.Request) ([]byte, error)

PerformHTTPRequestCircuitBreaker performs the supplied http.Request within a circuit breaker.

Types

type DiscoveryToken

type DiscoveryToken struct {
	State   string `json:"state"` // UP, RUNNING, DOWN ??
	Address string `json:"address"`
}

DiscoveryToken defines a struct for transmitting the state of a hystrix stream producer.

Jump to

Keyboard shortcuts

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