decorator

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecorateConsumer

type DecorateConsumer[T any] func(T) error

func OfConsumer

func OfConsumer[T any](fn func(T) error) DecorateConsumer[T]

func (DecorateConsumer[T]) Decorate

func (fn DecorateConsumer[T]) Decorate() func(T) error

func (DecorateConsumer[T]) WhenFull added in v0.2.1

func (fn DecorateConsumer[T]) WhenFull(fallbackFn func(T) error) DecorateConsumer[T]

func (DecorateConsumer[T]) WhenMaxRetries added in v0.2.1

func (fn DecorateConsumer[T]) WhenMaxRetries(fallbackFn func(T) error) DecorateConsumer[T]

func (DecorateConsumer[T]) WhenOverLoad added in v0.2.1

func (fn DecorateConsumer[T]) WhenOverLoad(fallbackFn func(T) error) DecorateConsumer[T]

func (DecorateConsumer[T]) WhenOverRate added in v0.2.1

func (fn DecorateConsumer[T]) WhenOverRate(fallbackFn func(T) error) DecorateConsumer[T]

func (DecorateConsumer[T]) WhenTimeout added in v0.2.1

func (fn DecorateConsumer[T]) WhenTimeout(fallbackFn func(T) error) DecorateConsumer[T]

func (DecorateConsumer[T]) WithBulkhead

func (fn DecorateConsumer[T]) WithBulkhead(entry bulkhead.Bulkhead) DecorateConsumer[T]

func (DecorateConsumer[T]) WithCircuitBreaker

func (fn DecorateConsumer[T]) WithCircuitBreaker(entry circuitbreaker.CircuitBreaker) DecorateConsumer[T]

func (DecorateConsumer[T]) WithFallback

func (fn DecorateConsumer[T]) WithFallback(
	fallbackFn func(T) error, predicate func(T, error, any) bool) DecorateConsumer[T]

func (DecorateConsumer[T]) WithRateLimiter

func (fn DecorateConsumer[T]) WithRateLimiter(entry ratelimiter.RateLimiter) DecorateConsumer[T]

func (DecorateConsumer[T]) WithRetry

func (fn DecorateConsumer[T]) WithRetry(entry retry.Retry) DecorateConsumer[T]

func (DecorateConsumer[T]) WithTimeLimiter

func (fn DecorateConsumer[T]) WithTimeLimiter(entry timelimiter.TimeLimiter) DecorateConsumer[T]

type DecorateFunction

type DecorateFunction[T any, R any] func(T) (R, error)

func OfFunction

func OfFunction[T any, R any](fn func(T) (R, error)) DecorateFunction[T, R]

func (DecorateFunction[T, R]) Decorate

func (fn DecorateFunction[T, R]) Decorate() func(T) (R, error)

func (DecorateFunction[T, R]) WhenFull added in v0.2.1

func (fn DecorateFunction[T, R]) WhenFull(fallbackFn func(T) (R, error)) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WhenMaxRetries added in v0.2.1

func (fn DecorateFunction[T, R]) WhenMaxRetries(fallbackFn func(T) (R, error)) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WhenOverLoad added in v0.2.1

func (fn DecorateFunction[T, R]) WhenOverLoad(fallbackFn func(T) (R, error)) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WhenOverRate added in v0.2.1

func (fn DecorateFunction[T, R]) WhenOverRate(fallbackFn func(T) (R, error)) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WhenTimeout added in v0.2.1

func (fn DecorateFunction[T, R]) WhenTimeout(fallbackFn func(T) (R, error)) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithBulkhead

func (fn DecorateFunction[T, R]) WithBulkhead(entry bulkhead.Bulkhead) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithCache added in v0.4.0

func (fn DecorateFunction[T, R]) WithCache(entry cache.Cache[T, R]) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithCircuitBreaker

func (fn DecorateFunction[T, R]) WithCircuitBreaker(entry circuitbreaker.CircuitBreaker) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithFallback

func (fn DecorateFunction[T, R]) WithFallback(
	fallbackFn func(T) (R, error), predicate func(T, R, error, any) bool) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithRateLimiter

func (fn DecorateFunction[T, R]) WithRateLimiter(entry ratelimiter.RateLimiter) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithRetry

func (fn DecorateFunction[T, R]) WithRetry(entry retry.Retry) DecorateFunction[T, R]

func (DecorateFunction[T, R]) WithTimeLimiter

func (fn DecorateFunction[T, R]) WithTimeLimiter(entry timelimiter.TimeLimiter) DecorateFunction[T, R]

type DecorateRunnable

type DecorateRunnable func() error

func OfRunnable

func OfRunnable(fn func() error) DecorateRunnable

func (DecorateRunnable) Decorate

func (fn DecorateRunnable) Decorate() func() error

func (DecorateRunnable) WhenFull added in v0.2.1

func (fn DecorateRunnable) WhenFull(fallbackFn func() error) DecorateRunnable

func (DecorateRunnable) WhenMaxRetries added in v0.2.1

func (fn DecorateRunnable) WhenMaxRetries(fallbackFn func() error) DecorateRunnable

func (DecorateRunnable) WhenOverLoad added in v0.2.1

func (fn DecorateRunnable) WhenOverLoad(fallbackFn func() error) DecorateRunnable

func (DecorateRunnable) WhenOverRate added in v0.2.1

func (fn DecorateRunnable) WhenOverRate(fallbackFn func() error) DecorateRunnable

func (DecorateRunnable) WhenTimeout added in v0.2.1

func (fn DecorateRunnable) WhenTimeout(fallbackFn func() error) DecorateRunnable

func (DecorateRunnable) WithBulkhead

func (fn DecorateRunnable) WithBulkhead(entry bulkhead.Bulkhead) DecorateRunnable

func (DecorateRunnable) WithCircuitBreaker

func (fn DecorateRunnable) WithCircuitBreaker(entry circuitbreaker.CircuitBreaker) DecorateRunnable

func (DecorateRunnable) WithFallback

func (fn DecorateRunnable) WithFallback(
	fallbackFn func() error, predicate func(error, any) bool) DecorateRunnable

func (DecorateRunnable) WithRateLimiter

func (fn DecorateRunnable) WithRateLimiter(entry ratelimiter.RateLimiter) DecorateRunnable

func (DecorateRunnable) WithRetry

func (fn DecorateRunnable) WithRetry(entry retry.Retry) DecorateRunnable

func (DecorateRunnable) WithTimeLimiter

func (fn DecorateRunnable) WithTimeLimiter(entry timelimiter.TimeLimiter) DecorateRunnable

type DecorateSupplier

type DecorateSupplier[T any] func() (T, error)

func OfSupplier

func OfSupplier[T any](fn func() (T, error)) DecorateSupplier[T]

func (DecorateSupplier[T]) Decorate

func (fn DecorateSupplier[T]) Decorate() func() (T, error)

func (DecorateSupplier[T]) WhenFull added in v0.2.1

func (fn DecorateSupplier[T]) WhenFull(fallbackFn func() (T, error)) DecorateSupplier[T]

func (DecorateSupplier[T]) WhenMaxRetries added in v0.2.1

func (fn DecorateSupplier[T]) WhenMaxRetries(fallbackFn func() (T, error)) DecorateSupplier[T]

func (DecorateSupplier[T]) WhenOverLoad added in v0.2.1

func (fn DecorateSupplier[T]) WhenOverLoad(fallbackFn func() (T, error)) DecorateSupplier[T]

func (DecorateSupplier[T]) WhenOverRate added in v0.2.1

func (fn DecorateSupplier[T]) WhenOverRate(fallbackFn func() (T, error)) DecorateSupplier[T]

func (DecorateSupplier[T]) WhenTimeout added in v0.2.1

func (fn DecorateSupplier[T]) WhenTimeout(fallbackFn func() (T, error)) DecorateSupplier[T]

func (DecorateSupplier[T]) WithBulkhead

func (fn DecorateSupplier[T]) WithBulkhead(entry bulkhead.Bulkhead) DecorateSupplier[T]

func (DecorateSupplier[T]) WithCircuitBreaker

func (fn DecorateSupplier[T]) WithCircuitBreaker(entry circuitbreaker.CircuitBreaker) DecorateSupplier[T]

func (DecorateSupplier[T]) WithFallback

func (fn DecorateSupplier[T]) WithFallback(
	fallbackFn func() (T, error), predicate func(T, error, any) bool) DecorateSupplier[T]

func (DecorateSupplier[T]) WithRateLimiter

func (fn DecorateSupplier[T]) WithRateLimiter(entry ratelimiter.RateLimiter) DecorateSupplier[T]

func (DecorateSupplier[T]) WithRetry

func (fn DecorateSupplier[T]) WithRetry(entry retry.Retry) DecorateSupplier[T]

func (DecorateSupplier[T]) WithTimeLimiter

func (fn DecorateSupplier[T]) WithTimeLimiter(entry timelimiter.TimeLimiter) DecorateSupplier[T]

Jump to

Keyboard shortcuts

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