Files
open-im-server/pkg/common/webhook/condition.go
T

14 lines
276 B
Go
Raw Normal View History

2024-04-19 22:23:08 +08:00
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)
}