Documentation ¶
Overview ¶
Package counter implements a counter which will persist the result in a local file.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter defines parameter for the counter.
Example ¶
tmpfile, _ := ioutil.TempFile("", "test") defer os.Remove(tmpfile.Name()) c, _ := Init(tmpfile.Name(), 0, 2) ch := make(chan int) c.Inc(ch) fmt.Println(<-ch) c.Inc(ch) fmt.Println(<-ch) c.Inc(ch) fmt.Println(<-ch)
Output: 1 2 3
Click to show internal directories.
Click to hide internal directories.