This commit is contained in:
Sodesnei 2021-09-19 14:59:27 +08:00
parent 2c6bd99ccc
commit e742267b68
2 changed files with 20 additions and 20 deletions

View File

@ -36,26 +36,6 @@ type middleWare interface {
Out() Msg
}
type Upload struct {
ch chan *data
}
func (m *Upload) Put(msg Msg) {
da := NewData()
da.Put("1", msg)
m.ch <- da
}
func (m *Upload) Out() Msg {
return <-m.ch
}
func NewUpload() *Upload {
return &Upload{
make(chan *data),
}
}
type MiddlewareConf struct {
Weight int
Middle middleWare

View File

@ -1 +1,21 @@
package middle
type Upload struct {
ch chan *data
}
func (m *Upload) Put(msg Msg) {
da := NewData()
da.Put("1", msg)
m.ch <- da
}
func (m *Upload) Out() Msg {
return <-m.ch
}
func NewUpload() *Upload {
return &Upload{
make(chan *data),
}
}