mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 03:42:08 +08:00
14 lines
276 B
Go
14 lines
276 B
Go
package webhook
|
|
|
|
import (
|
|
"context"
|
|
"github.com/openimsdk/open-im-server/v3/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)
|
|
}
|