diff options
Diffstat (limited to 'session.go')
-rw-r--r-- | session.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |