package
Version:
v0.0.0-...-c635e59
Opens a new window with list of versions in this module.
Published: May 20, 2024
License: Apache-2.0, BSD-2-Clause
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 77
Opens a new window with list of known importers.
Documentation
¶
Code generated by go generate; DO NOT EDIT.
-
func CreateGroupConstructor[GroupType any, GroupPtrType ptrGroupType[GroupType, GroupPtrType]](newFunc func() GroupPtrType) func(...GroupPtrType) GroupPtrType
-
func IsInterfaceNil(param interface{}) bool
-
type Event
-
type Event1
-
type Event2
-
type Event3
-
type Event4
-
func (e Event4) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
-
func (e *Event4[T1, T2, T3, T4]) LinkTo(target *Event4[T1, T2, T3, T4])
-
func (e *Event4[T1, T2, T3, T4]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4)
-
type Event5
-
func (e Event5) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
-
func (e *Event5[T1, T2, T3, T4, T5]) LinkTo(target *Event5[T1, T2, T3, T4, T5])
-
func (e *Event5[T1, T2, T3, T4, T5]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5)
-
type Event6
-
func New6[T1, T2, T3, T4, T5, T6 any](opts ...Option) *Event6[T1, T2, T3, T4, T5, T6]
-
func (e Event6) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
-
func (e *Event6[T1, T2, T3, T4, T5, T6]) LinkTo(target *Event6[T1, T2, T3, T4, T5, T6])
-
func (e *Event6[T1, T2, T3, T4, T5, T6]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6)
-
type Event7
-
func New7[T1, T2, T3, T4, T5, T6, T7 any](opts ...Option) *Event7[T1, T2, T3, T4, T5, T6, T7]
-
func (e Event7) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
-
func (e *Event7[T1, T2, T3, T4, T5, T6, T7]) LinkTo(target *Event7[T1, T2, T3, T4, T5, T6, T7])
-
func (e *Event7[T1, T2, T3, T4, T5, T6, T7]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6, arg7 T7)
-
type Event8
-
func New8[T1, T2, T3, T4, T5, T6, T7, T8 any](opts ...Option) *Event8[T1, T2, T3, T4, T5, T6, T7, T8]
-
func (e Event8) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
-
func (e *Event8[T1, T2, T3, T4, T5, T6, T7, T8]) LinkTo(target *Event8[T1, T2, T3, T4, T5, T6, T7, T8])
-
func (e *Event8[T1, T2, T3, T4, T5, T6, T7, T8]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6, arg7 T7, arg8 T8)
-
type Event9
-
func New9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](opts ...Option) *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9]
-
func (e Event9) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
-
func (e *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) LinkTo(target *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9])
-
func (e *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6, arg7 T7, arg8 T8, ...)
-
type Group
-
type Hook
-
type Option
func CreateGroupConstructor[GroupType any, GroupPtrType ptrGroupType[GroupType, GroupPtrType]](newFunc func() GroupPtrType) func(...GroupPtrType) GroupPtrType
CreateGroupConstructor returns the linkable constructor for the given event group.
func IsInterfaceNil(param interface{}) bool
Event is an event with no generic parameters.
New creates a new event with no generic parameters.
func (e Event) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
LinkTo links the event to the given target event (nil unlinks).
func (e *Event) Trigger()
Trigger invokes the hooked callbacks.
type Event1[T1 any] struct {
}
Event1 is an event with 1 generic parameters.
New1 creates a new event with 1 generic parameters.
func (e Event1) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
LinkTo links the event to the given target event (nil unlinks).
func (e *Event1[T1]) Trigger(arg1 T1)
Trigger invokes the hooked callbacks with the given parameters.
type Event2[T1, T2 any] struct {
}
Event2 is an event with 2 generic parameters.
New2 creates a new event with 2 generic parameters.
func (e Event2) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
LinkTo links the event to the given target event (nil unlinks).
func (e *Event2[T1, T2]) Trigger(arg1 T1, arg2 T2)
Trigger invokes the hooked callbacks with the given parameters.
type Event3[T1, T2, T3 any] struct {
}
Event3 is an event with 3 generic parameters.
New3 creates a new event with 3 generic parameters.
func (e Event3) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event3[T1, T2, T3]) LinkTo(target *Event3[T1, T2, T3])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event3[T1, T2, T3]) Trigger(arg1 T1, arg2 T2, arg3 T3)
Trigger invokes the hooked callbacks with the given parameters.
type Event4[T1, T2, T3, T4 any] struct {
}
Event4 is an event with 4 generic parameters.
New4 creates a new event with 4 generic parameters.
func (e Event4) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event4[T1, T2, T3, T4]) LinkTo(target *Event4[T1, T2, T3, T4])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event4[T1, T2, T3, T4]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4)
Trigger invokes the hooked callbacks with the given parameters.
type Event5[T1, T2, T3, T4, T5 any] struct {
}
Event5 is an event with 5 generic parameters.
func New5[T1, T2, T3, T4, T5 any](opts ...Option) *Event5[T1, T2, T3, T4, T5]
New5 creates a new event with 5 generic parameters.
func (e Event5) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event5[T1, T2, T3, T4, T5]) LinkTo(target *Event5[T1, T2, T3, T4, T5])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event5[T1, T2, T3, T4, T5]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5)
Trigger invokes the hooked callbacks with the given parameters.
type Event6[T1, T2, T3, T4, T5, T6 any] struct {
}
Event6 is an event with 6 generic parameters.
func New6[T1, T2, T3, T4, T5, T6 any](opts ...Option) *Event6[T1, T2, T3, T4, T5, T6]
New6 creates a new event with 6 generic parameters.
func (e Event6) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event6[T1, T2, T3, T4, T5, T6]) LinkTo(target *Event6[T1, T2, T3, T4, T5, T6])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event6[T1, T2, T3, T4, T5, T6]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6)
Trigger invokes the hooked callbacks with the given parameters.
type Event7[T1, T2, T3, T4, T5, T6, T7 any] struct {
}
Event7 is an event with 7 generic parameters.
func New7[T1, T2, T3, T4, T5, T6, T7 any](opts ...Option) *Event7[T1, T2, T3, T4, T5, T6, T7]
New7 creates a new event with 7 generic parameters.
func (e Event7) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event7[T1, T2, T3, T4, T5, T6, T7]) LinkTo(target *Event7[T1, T2, T3, T4, T5, T6, T7])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event7[T1, T2, T3, T4, T5, T6, T7]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6, arg7 T7)
Trigger invokes the hooked callbacks with the given parameters.
type Event8[T1, T2, T3, T4, T5, T6, T7, T8 any] struct {
}
Event8 is an event with 8 generic parameters.
func New8[T1, T2, T3, T4, T5, T6, T7, T8 any](opts ...Option) *Event8[T1, T2, T3, T4, T5, T6, T7, T8]
New8 creates a new event with 8 generic parameters.
func (e Event8) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event8[T1, T2, T3, T4, T5, T6, T7, T8]) LinkTo(target *Event8[T1, T2, T3, T4, T5, T6, T7, T8])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event8[T1, T2, T3, T4, T5, T6, T7, T8]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6, arg7 T7, arg8 T8)
Trigger invokes the hooked callbacks with the given parameters.
type Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any] struct {
}
Event9 is an event with 9 generic parameters.
func New9[T1, T2, T3, T4, T5, T6, T7, T8, T9 any](opts ...Option) *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9]
New9 creates a new event with 9 generic parameters.
func (e Event9) Hook(triggerFunc TriggerFunc, opts ...Option) *Hook[TriggerFunc]
Hook adds a new callback to the event and returns the corresponding Hook.
func (e *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) LinkTo(target *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9])
LinkTo links the event to the given target event (nil unlinks).
func (e *Event9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) Trigger(arg1 T1, arg2 T2, arg3 T3, arg4 T4, arg5 T5, arg6 T6, arg7 T7, arg8 T8, arg9 T9)
Trigger invokes the hooked callbacks with the given parameters.
type Group[GroupType any, GroupPtrType ptrGroupType[GroupType, GroupPtrType]] struct {
sync.Once
}
Group is a trait that can be embedded into a struct to make the contained events linkable.
func (g *Group[GroupType, GroupPtrType]) LinkTo(target GroupPtrType)
LinkTo links the group to another group of the same type (nil unlinks).
type Hook[TriggerFunc any] struct {
}
Hook is a container that holds a trigger function and its trigger settings.
func (t Hook) MaxTriggerCount() int
MaxTriggerCount returns the maximum number of times Trigger can be called.
func (t Hook) MaxTriggerCountReached() bool
MaxTriggerCountReached returns true if the maximum number of times Trigger can be called was reached.
func (t Hook) TriggerCount() int
TriggerCount returns the number of times Trigger was called.
func (h *Hook[TriggerFunc]) Unhook()
Unhook removes the callback from the event.
func (t Hook) WasTriggered() bool
WasTriggered returns true if Trigger was called at least once.
WorkerPool returns the worker pool that is used to trigger the callback.
Option is a function that configures the triggerSettings.
WithMaxTriggerCount sets the maximum number of times an entity shall be triggered.
func WithPreTriggerFunc(preTriggerFunc any) Option
WithPreTriggerFunc sets a function that is synchronously called before the trigger is executed.
WithWorkerPool sets the worker pool that is used to process the trigger (nil forces execution in-place).
Source Files
¶
Click to show internal directories.
Click to hide internal directories.