wheat-cache/pkg/middle/upload.go

26 lines
297 B
Go
Raw Permalink Normal View History

2021-08-30 14:46:31 +08:00
package middle
2021-09-19 14:59:27 +08:00
2021-09-19 18:11:43 +08:00
import "fmt"
2021-09-19 14:59:27 +08:00
type Upload struct {
ch chan *data
}
2021-09-19 18:11:43 +08:00
func NewUpload() *Upload {
return &Upload{
make(chan *data),
}
}
2021-09-19 14:59:27 +08:00
func (m *Upload) Put(msg Msg) {
da := NewData()
da.Put("1", msg)
2021-09-19 18:11:43 +08:00
fmt.Println("传入Upload")
2021-09-19 14:59:27 +08:00
m.ch <- da
}
func (m *Upload) Out() Msg {
return <-m.ch
}