This commit is contained in:
Zane.Y 2017-07-19 11:51:26 +08:00
commit e77f0c32b3
3 changed files with 8 additions and 4 deletions

View File

@ -3,8 +3,10 @@
<p>Provide functional programming interface in golang</p> <p>Provide functional programming interface in golang</p>
使用指南: 使用指南:
<p>0.拉取工具包</p>
<p><code>go get github.com/ZaneYork/go-func/stream</code></p>
<p>1.引入工具包:</p> <p>1.引入工具包:</p>
<p><code>import . "github.com/go-func/stream"</code></p> <p><code>import . "github.com/ZaneYork/go-func/stream"</code></p>
<p>2.使用<code>NewSteam</code>或者<code>NewParallelStream</code>函数开启数据流</p> <p>2.使用<code>NewSteam</code>或者<code>NewParallelStream</code>函数开启数据流</p>
<p>3.然后追加流操作函数以修改数据</p> <p>3.然后追加流操作函数以修改数据</p>
<p>4.使用如Collect、Reduce等流终结操作函数拿到处理结果集</p> <p>4.使用如Collect、Reduce等流终结操作函数拿到处理结果集</p>
@ -12,8 +14,10 @@
<p>本工具包提供的并发数据流在处理压力较低或者单核机器上时,并发处理为负优化,请斟酌选择是否并发</p> <p>本工具包提供的并发数据流在处理压力较低或者单核机器上时,并发处理为负优化,请斟酌选择是否并发</p>
<hr> <hr>
Usage: Usage:
<p>0.Clone source code</p>
<p><code>go get github.com/ZaneYork/go-func/stream</code></p>
<p>1.import package:</p> <p>1.import package:</p>
<p><code>import . "github.com/go-func/stream"</code></p> <p><code>import . "github.com/ZaneYork/go-func/stream"</code></p>
<p>2.Start steam with function <code>NewSteam</code> or <code>NewParallelStream</code></p> <p>2.Start steam with function <code>NewSteam</code> or <code>NewParallelStream</code></p>
<p>3.Append operation function to modify element in stream</p> <p>3.Append operation function to modify element in stream</p>
<p>4.Terminate stream with any termination operation like Collect,Reduce,etc. </p> <p>4.Terminate stream with any termination operation like Collect,Reduce,etc. </p>

View File

@ -1,6 +1,6 @@
package collectors package collectors
import . "github.com/go-func/stream" import . "github.com/ZaneYork/go-func/stream"
// GroupingBy 按照指定的规则分组 // GroupingBy 按照指定的规则分组
type GroupingBy struct { type GroupingBy struct {

View File

@ -1,6 +1,6 @@
package collectors package collectors
import . "github.com/go-func/stream" import . "github.com/ZaneYork/go-func/stream"
// PartitioningBy 按照指定的分区 // PartitioningBy 按照指定的分区
type PartitioningBy struct { type PartitioningBy struct {