1 Star 0 Fork 0

qw_1215 / glink

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
chan.go 559 Bytes
一键复制 编辑 原始数据 按行查看 历史
qw_1215 提交于 2020-03-12 22:26 . 项目初始化
package source
import (
streams "gitee.com/qw_1215/glink"
"gitee.com/qw_1215/glink/flow"
)
// ChanSource streams data from chan
type ChanSource struct {
in chan interface{}
}
// NewChanSource returns new ChanSource instance
func NewChanSource(in chan interface{}) *ChanSource {
return &ChanSource{in}
}
// Via streams data through given flow
func (cs *ChanSource) Via(_flow streams.Flow) streams.Flow {
flow.DoStream(cs, _flow)
return _flow
}
// Out returns channel for sending data
func (cs *ChanSource) Out() <-chan interface{} {
return cs.in
}
Go
1
https://gitee.com/qw_1215/glink.git
git@gitee.com:qw_1215/glink.git
qw_1215
glink
glink
195e12e86392

搜索帮助