summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core.go1
-rw-r--r--session.go8
2 files changed, 5 insertions, 4 deletions
diff --git a/core.go b/core.go
index 58633d8..f74f422 100644
--- a/core.go
+++ b/core.go
@@ -52,6 +52,7 @@ func init() {
}
type ImportProgressCB func(step int, stepName string, progress float64, userdata interface{}) bool
+type ImportDoneCB func(ImportResult, interface{}) bool
type ImportContext struct {
conf *Config
diff --git a/session.go b/session.go
index 82ab3cf..80acee1 100644
--- a/session.go
+++ b/session.go
@@ -62,7 +62,7 @@ type SessionProgressCB struct {
}
type SessionDoneCB struct {
- cb func(ImportResult, interface{}) bool
+ cb ImportDoneCB
userdata interface{}
}
@@ -88,7 +88,7 @@ type sessionAddDoneHandlerResponse struct {
type sessionAddDoneHandlerRequest struct {
userdata interface{}
- callback func(ImportResult, interface{}) bool
+ callback ImportDoneCB
response chan<- sessionAddDoneHandlerResponse
}
@@ -148,7 +148,7 @@ func (self *Session) addProgressHandler(userdata interface{}, cb ImportProgressC
return
}
-func (self *Session) addDoneHandler(userdata interface{}, cb func(ImportResult, interface{}) bool) (resp sessionAddDoneHandlerResponse) {
+func (self *Session) addDoneHandler(userdata interface{}, cb ImportDoneCB) (resp sessionAddDoneHandlerResponse) {
if self.state != SESSION_NEW && self.state != SESSION_RUNNING {
resp.err = fmt.Errorf("session is already done/canceled")
}
@@ -262,7 +262,7 @@ func (self *SessionChan) AddProgressHandler(userdata interface{}, cb ImportProgr
return res.err
}
-func (self *SessionChan) AddDoneHandler(userdata interface{}, cb func(ImportResult, interface{}) bool) error {
+func (self *SessionChan) AddDoneHandler(userdata interface{}, cb ImportDoneCB) error {
resCh := make(chan sessionAddDoneHandlerResponse)
req := sessionAddDoneHandlerRequest{}
req.userdata = userdata