counter

package module
v0.0.0-...-e96e2b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2017 License: MIT Imports: 4 Imported by: 0

README

Flow-based programming and concurrency

This is an example of a FBP flow using only go channels and pipelines. It counts the words and letters in sentences

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Joiner

func Joiner(channels ...<-chan fmt.Stringer) <-chan fmt.Stringer

Joiner joins two or more Stringer channels into a single Stringer channel

func LetterCounter

func LetterCounter(sentences <-chan string) <-chan fmt.Stringer

LetterCounter is a process that counts letters in a string

func Printer

func Printer(values <-chan fmt.Stringer) <-chan struct{}

Printer prints the values sent to it

func Spliter

func Spliter(sentences <-chan string) (<-chan string, <-chan string)

Spliter copies a string to two channels

func WordCounter

func WordCounter(sentences <-chan string) <-chan fmt.Stringer

WordCounter is a step that counts the words in a string

Types

type Letters

type Letters struct {
	Count int
}

Letter represents a letter count

func (Letters) String

func (l Letters) String() string

type Words

type Words struct {
	Count int
}

Words represents a word count

func (Words) String

func (w Words) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL