xsentinel

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDefaultSlotChain

func BuildDefaultSlotChain() *base.SlotChain

func Entry

func Entry(resource string, opts ...api.EntryOption) (*base.SentinelEntry, *base.BlockError)

func GlobalSlotChain

func GlobalSlotChain() *base.SlotChain

func Init

func Init(opt *Option) error

func TraceError

func TraceError(entry *base.SentinelEntry, err error)

Types

type BlockError

type BlockError struct {
	BlockErr *base.BlockError
	Err      error
}

BlockError 用来存储sentinel的熔断错误和用户自身错误

func (*BlockError) Error

func (e *BlockError) Error() string

func (*BlockError) Unwrap

func (e *BlockError) Unwrap() error

type Logger

type Logger struct {
	logging.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg string, keysAndValues ...interface{})

func (*Logger) Error

func (l *Logger) Error(err error, msg string, keysAndValues ...interface{})
func (l *Logger) WarnEnabled() bool {
	return l.logger.GetLevel() >= log.WarnLevel
}

func (*Logger) Info

func (l *Logger) Info(msg string, keysAndValues ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string, keysAndValues ...interface{})
func (l *Logger) InfoEnabled() bool {
	return l.logger.GetLevel() >= log.InfoLevel
}

type Option

type Option struct {
	CircuitBreakerRules []*circuitbreaker.Rule
	FlowRules           []*flow.Rule
	HotspotRules        []*hotspot.Rule
	IsolationRules      []*isolation.Rule
	SystemRules         []*system.Rule
}

Jump to

Keyboard shortcuts

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