Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Notify ¶
func Notify(observation Observation)
Notify sends a notification about the given Observation to the observers that attached to the relevant observable.
Types ¶
type Event ¶
type Event int
Event is an event
const ( // Community Events // Auth Code Flow CEventAuthCodeSuccess Event = iota CEventAuthCodeFail // Device Flow CEventDeviceFlowSuccess CEventDeviceFlowSuccessWorkAround CEventDeviceFlowFail // Token Revocation CEventTokenRevocationFail CEventTokenRevocationRTOnly CEventTokenRevocationRTAndAT // ID Token Signature CEventIDTokenSignatureValid CEventIDTokenSignatureInvalid // AT Signature CEventAccessTokenSignatureValid CEventAccessTokenSignatureInvalid // Refresh Token JWT CEventRefreshTokenIsAJWT CEventRefreshTokenIsNotAJWT // Access Token JWT CEventAccessTokenIsAJWT CEventAccessTokenIsNotAJWT // Other Events EventFeatureValueChanged EventMailVerified )
Defines the different events
type Observation ¶
Observation holds the Event of an observation, a related identifier string, and a value
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer is an struct that observers one or multiple Events.
func NewAttachedAndObservingObserver ¶
NewAttachedAndObservingObserver creates a new Observer, attaches, and starts observing.
func NewAttachedAndObservingTrueFalseObserver ¶
func NewAttachedAndObservingTrueFalseObserver(spec TrueFalseObserverSpec) *Observer
NewAttachedAndObservingTrueFalseObserver creates a new TrueFalseObserver, attaches, and starts observing.
func NewTrueFalseObserver ¶
func NewTrueFalseObserver(spec TrueFalseObserverSpec) *Observer
NewTrueFalseObserver creates a new Observer. This observer will only listen to two events which are considered as true and false. On an observation this value is passed to the trueFalseObserverCallback.
func (*Observer) AttachAndObserve ¶
func (obs *Observer) AttachAndObserve()
AttachAndObserve attaches to the relevant observables and starts observing.
type TrueFalseObserverSpec ¶
type TrueFalseObserverSpec struct { TrueEvent Event FalseEvent Event Action trueFalseObserverCallback }
TrueFalseObserverSpec describes an TrueFalseObserver