breaker

package
v0.0.0-...-26e1b9e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

Breaker模块

Breaker模块主要用于熔断限流。

使用示例:

import "gitee.com/peyton1991/kuat/breaker"

breaker.Go("my_command", func() error {
	// talk to other services
	return nil
}, nil)

...

breaker.Go("my_command", func() error {
	// talk to other services
	return nil
}, func(err error) error {
	// do this when services are down
	return nil
})

breaker主要是封装了hystrix库,实现比较简单。基于不同的策略来进行熔断限流。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(config *Config)

Types

type Config

type Config struct {
	Name        string                `json:"name" yaml:"name"`
	CommandConf hystrix.CommandConfig `json:"commandConf" yaml:"commandConf"`
}

Jump to

Keyboard shortcuts

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