复制项目
This commit is contained in:
14
pkg/common/webhook/condition.go
Normal file
14
pkg/common/webhook/condition.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package webhook
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.imall.cloud/openim/open-im-server-deploy/pkg/common/config"
|
||||
)
|
||||
|
||||
func WithCondition(ctx context.Context, before *config.BeforeConfig, callback func(context.Context) error) error {
|
||||
if !before.Enable {
|
||||
return nil
|
||||
}
|
||||
return callback(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user