From 2f3a1cac0ab442bb336bf4cb91407aca33356b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Matczuk?= Date: Mon, 20 Dec 2021 14:21:32 +0100 Subject: [PATCH] migrate: add CallbackRegister::Find --- migrate/callback.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migrate/callback.go b/migrate/callback.go index 0288261..b94dc21 100644 --- a/migrate/callback.go +++ b/migrate/callback.go @@ -48,6 +48,11 @@ func (r CallbackRegister) Add(ev CallbackEvent, name string, f CallbackFunc) { r[nameEvent{name, ev}] = f } +// Find returns the registered handler. +func (r CallbackRegister) Find(ev CallbackEvent, name string) CallbackFunc { + return r[nameEvent{name, ev}] +} + // Callback is CallbackFunc. func (r CallbackRegister) Callback(ctx context.Context, session gocqlx.Session, ev CallbackEvent, name string) error { f, ok := r[nameEvent{name, ev}]