https://github.com/sug0/go-seq
Generate alphabetical sequential IDs
https://github.com/sug0/go-seq
alphabetical generator go golang id sequential
Last synced: 2 months ago
JSON representation
Generate alphabetical sequential IDs
- Host: GitHub
- URL: https://github.com/sug0/go-seq
- Owner: sug0
- License: mit
- Created: 2018-07-14T02:08:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T05:46:18.000Z (over 4 years ago)
- Last Synced: 2025-02-13T08:54:11.863Z (4 months ago)
- Topics: alphabetical, generator, go, golang, id, sequential
- Language: Go
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-seq
Painless alphabetical sequential IDs.
# Documentation
Visit [godoc](https://godoc.org/github.com/sugoiuguu/go-seq).
# Get this package
```
$ go get github.com/sugoiuguu/go-seq
```# Example
## New
```go
// create a new sequence
seq := sequence.NewSeq()fmt.Printf("%q\n", seq.Next())
```## Encode
```go
// create a new sequence
seq := sequence.NewSeq()// create a new encoder that outputs to stdout
dec := json.NewEncoder(os.Stdout)if err := enc.Encode(seq); err != nil {
panic(err)
}
```## Decode
```go
// the sequence we'll initialize
var seq sequence.Seq// create a new decoder that reads from stdin
dec := json.NewDecoder(os.Stdin)if err := dec.Decode(&seq); err != nil {
panic(err)
}fmt.Printf("%q\n", seq.Next())
```