package
Version:
v1.3.2
Opens a new window with list of versions in this module.
Published: Sep 12, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Chain[T any](component T, decorators ...Decorator[T]) T
Chain decorates the given object with all middlewares.
type Decorator[T any] interface {
Decorate(component T) T
}
Decorator allows us to write something like decorators to component.
It can execute something before invoke or after.
type Func[T any] func(component T) T
Func is an adapter to allow the use of ordinary functions as Decorator.
func (f Func[T]) Decorate(component T) T
Decorate call f(obj).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.