You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/selector/global.go

21 lines
500 B

package selector
var globalSelector = &wrapSelector{}
var _ Builder = (*wrapSelector)(nil)
// wrapSelector wrapped Selector, help override global Selector implementation.
type wrapSelector struct{ Builder }
// GlobalSelector returns global selector builder.
func GlobalSelector() Builder {
if globalSelector.Builder != nil {
return globalSelector
}
return nil
}
// SetGlobalSelector set global selector builder.
func SetGlobalSelector(builder Builder) {
globalSelector.Builder = builder
}