summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport/rddb.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimport/rddb.go')
-rw-r--r--src/helsinki.at/rhimport/rddb.go28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/helsinki.at/rhimport/rddb.go b/src/helsinki.at/rhimport/rddb.go
index 25ef876..f596171 100644
--- a/src/helsinki.at/rhimport/rddb.go
+++ b/src/helsinki.at/rhimport/rddb.go
@@ -49,7 +49,7 @@ type getPasswordResult struct {
type getPasswordRequest struct {
username string
cached bool
- response chan getPasswordResult
+ response chan<- getPasswordResult
}
type getGroupOfCartResult struct {
@@ -59,7 +59,7 @@ type getGroupOfCartResult struct {
type getGroupOfCartRequest struct {
cart uint
- response chan getGroupOfCartResult
+ response chan<- getGroupOfCartResult
}
type getShowInfoResult struct {
@@ -73,7 +73,7 @@ type getShowInfoResult struct {
type getShowInfoRequest struct {
showid uint
- response chan getShowInfoResult
+ response chan<- getShowInfoResult
}
type checkMusicGroupResult struct {
@@ -83,7 +83,7 @@ type checkMusicGroupResult struct {
type checkMusicGroupRequest struct {
group string
- response chan checkMusicGroupResult
+ response chan<- checkMusicGroupResult
}
type getMusicInfoResult struct {
@@ -94,7 +94,15 @@ type getMusicInfoResult struct {
type getMusicInfoRequest struct {
group string
- response chan getMusicInfoResult
+ response chan<- getMusicInfoResult
+}
+
+type RdDbChan struct {
+ getPasswordChan chan<- getPasswordRequest
+ getGroupOfCartChan chan<- getGroupOfCartRequest
+ getShowInfoChan chan<- getShowInfoRequest
+ checkMusicGroupChan chan<- checkMusicGroupRequest
+ getMusicInfoChan chan<- getMusicInfoRequest
}
type RdDb struct {
@@ -289,6 +297,16 @@ func (self *RdDb) dispatchRequests() {
}
}
+func (self *RdDb) GetChannels() *RdDbChan {
+ ch := &RdDbChan{}
+ ch.getPasswordChan = self.getPasswordChan
+ ch.getGroupOfCartChan = self.getGroupOfCartChan
+ ch.getShowInfoChan = self.getShowInfoChan
+ ch.checkMusicGroupChan = self.checkMusicGroupChan
+ ch.getMusicInfoChan = self.getMusicInfoChan
+ return ch
+}
+
func (self *RdDb) Cleanup() {
self.quit <- true
<-self.done