diff --git a/vendor/github.com/chilts/sid/ReadMe.md b/vendor/github.com/chilts/sid/ReadMe.md
index b4653cb..7761928 100644
--- a/vendor/github.com/chilts/sid/ReadMe.md
+++ b/vendor/github.com/chilts/sid/ReadMe.md
@@ -20,13 +20,19 @@ go get github.com/chilts/sid
```
id1 := sid.Id()
-id2 := sid.Id()
+id2 := sid.IdHex()
+id3 := sid.IdBase32()
+id4 := sid.IdBase64()
fmt.Printf("id1 = %s\n", id1)
fmt.Printf("id2 = %s\n", id2)
+fmt.Printf("id3 = %s\n", id3)
+fmt.Printf("id4 = %s\n", id4)
-// -> "id1 = 1IeSBAWW83j-2wgJ4PUtlAr"
-// -> "id2 = 1IeSBAWW9kK-0cDG64GQgGJ"
+// -> "id1 = 1559872035903071353-1186579057231285506"
+// -> "id2 = 15a5cf57e7d2a837-6eaafe687e7b3ec3"
+// -> "id3 = 1b9efqnl51jj7-4u66ikpfq9ugm"
+// -> "id4 = 1IeSBAWW9kK-0cDG64GQgGJ"
```
## Author
@@ -37,6 +43,6 @@ For [AppsAttic](https://appsattic.com/), [@AppsAttic](https://twitter.com/AppsAt
## License
-[MIT](https://publish.li/mit-qLQqmVTO).
+[MIT](https://chilts.mit-license.org/2017/)
(Ends)
diff --git a/vendor/github.com/chilts/sid/go.mod b/vendor/github.com/chilts/sid/go.mod
new file mode 100644
index 0000000..fbe38d8
--- /dev/null
+++ b/vendor/github.com/chilts/sid/go.mod
@@ -0,0 +1,3 @@
+module github.com/chilts/sid
+
+go 1.12
diff --git a/vendor/github.com/chilts/sid/sid.go b/vendor/github.com/chilts/sid/sid.go
index 7c1f2c8..d3b55e3 100644
--- a/vendor/github.com/chilts/sid/sid.go
+++ b/vendor/github.com/chilts/sid/sid.go
@@ -12,6 +12,7 @@
package sid
import (
+ "fmt"
"math/rand"
"strconv"
"strings"
@@ -32,17 +33,39 @@ var chars = make([]string, 11, 11)
// 64 chars but ordered by ASCII
const base64 string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~"
-func toStr(now int64) string {
+func toStr(n int64) string {
// now do the generation (backwards, so we just %64 then /64 along the way)
for i := 10; i >= 0; i-- {
- index := now % 64
+ index := n % 64
chars[i] = string(base64[index])
- now = now / 64
+ n = n / 64
}
return strings.Join(chars, "")
}
+func toBase32(n int64) string {
+ b32 := strconv.FormatInt(n, 32)
+
+ for len(b32) < 13 {
+ b32 = "0" + b32
+ }
+
+ // log.Printf("b32=%s\n", b32)
+
+ return b32
+}
+
+func toHex(n int64) string {
+ hex := fmt.Sprintf("%x", n)
+
+ for len(hex) < 16 {
+ hex = "0" + hex
+ }
+
+ return hex
+}
+
// IdBase64 returns a 23 char string based on timestamp and a random number. The format is "XXXXXXXXXXX-YYYYYYYYYYY"
// where X is the timestamp and Y is the random number. If (by any chance) this is called in the same nanosecond, the
// random number is incremented instead of a new one being generated. This makes sure that two consecutive Ids
@@ -71,10 +94,66 @@ func IdBase64() string {
return toStr(now) + "-" + toStr(r)
}
-// Id returns a 23 char string based on timestamp and a random number. The format is "XXXXXXXXXXX-YYYYYYYYYYY" where X
-// is the timestamp and Y is the random number. If (by any chance) this is called in the same nanosecond, the random
-// number is incremented instead of a new one being generated. This makes sure that two consecutive Ids generated in
-// the same goroutine also ensure those Ids are also sortable.
+// IdBase32 returns a 27 char string based on timestamp and a random number. The format is
+// "XXXXXXXXXXXXX-YYYYYYYYYYYYY" where X is the timestamp and Y is the random number. If (by any chance) this is called
+// in the same nanosecond, the random number is incremented instead of a new one being generated. This makes sure that
+// two consecutive Ids generated in the same goroutine also ensure those Ids are also sortable.
+//
+// It is safe to call from different goroutines since it has it's own locking.
+func IdBase32() string {
+ // lock for lastTime, lastRand, and chars
+ mu.Lock()
+ defer mu.Unlock()
+
+ now := time.Now().UTC().UnixNano()
+ var r int64
+
+ // if we have the same time, just inc lastRand, else create a new one
+ if now == lastTime {
+ lastRand++
+ } else {
+ lastRand = rand.Int63()
+ }
+ r = lastRand
+
+ // remember this for next time
+ lastTime = now
+
+ return toBase32(now) + "-" + toBase32(r)
+}
+
+// IdHex returns a char string based on timestamp and a random number. The format is
+// "XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY" where X is the timestamp and Y is the random number. If (by any chance) this is
+// called in the same nanosecond, the random number is incremented instead of a new one being generated. This makes
+// sure that two consecutive Ids generated in the same goroutine also ensure those Ids are also sortable.
+//
+// It is safe to call from different goroutines since it has it's own locking.
+func IdHex() string {
+ // lock for lastTime, lastRand, and chars
+ mu.Lock()
+ defer mu.Unlock()
+
+ now := time.Now().UTC().UnixNano()
+ var r int64
+
+ // if we have the same time, just inc lastRand, else create a new one
+ if now == lastTime {
+ lastRand++
+ } else {
+ lastRand = rand.Int63()
+ }
+ r = lastRand
+
+ // remember this for next time
+ lastTime = now
+
+ return toHex(now) + "-" + toHex(r)
+}
+
+// Id returns a 39 char string based on timestamp and a random number. The format is
+// "XXXXXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYYYYY" where X is the timestamp and Y is the random number. If (by any chance)
+// this is called in the same nanosecond, the random number is incremented instead of a new one being generated. This
+// makes sure that two consecutive Ids generated in the same goroutine also ensure those Ids are also sortable.
//
// It is safe to call from different goroutines since it has it's own locking.
func Id() string {
diff --git a/vendor/github.com/olekukonko/tablewriter/README.md b/vendor/github.com/olekukonko/tablewriter/README.md
index 92d71ed..cb5e137 100644
--- a/vendor/github.com/olekukonko/tablewriter/README.md
+++ b/vendor/github.com/olekukonko/tablewriter/README.md
@@ -283,7 +283,7 @@ import (
func main() {
tableString := &strings.Builder{}
- table := tablewriter.NewWriter(tableString)
+ table := tablewriter.NewWriter(tableString)
/*
* Code to fill the table
diff --git a/vendor/github.com/olekukonko/tablewriter/go.mod b/vendor/github.com/olekukonko/tablewriter/go.mod
new file mode 100644
index 0000000..84b405d
--- /dev/null
+++ b/vendor/github.com/olekukonko/tablewriter/go.mod
@@ -0,0 +1,8 @@
+module github.com/olekukonko/tablewriter
+
+go 1.12
+
+require (
+ github.com/mattn/go-runewidth v0.0.4
+ github.com/olekukonko/tablewriter v0.0.1
+)
diff --git a/vendor/github.com/olekukonko/tablewriter/go.sum b/vendor/github.com/olekukonko/tablewriter/go.sum
new file mode 100644
index 0000000..9d5e335
--- /dev/null
+++ b/vendor/github.com/olekukonko/tablewriter/go.sum
@@ -0,0 +1,4 @@
+github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
+github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
+github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88=
+github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
diff --git a/vendor/github.com/olekukonko/tablewriter/table.go b/vendor/github.com/olekukonko/tablewriter/table.go
index 3cf0996..06341bc 100644
--- a/vendor/github.com/olekukonko/tablewriter/table.go
+++ b/vendor/github.com/olekukonko/tablewriter/table.go
@@ -766,7 +766,7 @@ func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx
if t.autoMergeCells {
//Store the full line to merge mutli-lines cells
- fullLine := strings.Join(columns[y], " ")
+ fullLine := strings.TrimRight(strings.Join(columns[y], " "), " ")
if len(previousLine) > y && fullLine == previousLine[y] && fullLine != "" {
// If this cell is identical to the one above but not empty, we don't display the border and keep the cell empty.
displayCellBorder = append(displayCellBorder, false)
@@ -804,7 +804,7 @@ func (t *Table) printRowMergeCells(writer io.Writer, columns [][]string, rowIdx
//The new previous line is the current one
previousLine = make([]string, total)
for y := 0; y < total; y++ {
- previousLine[y] = strings.Join(columns[y], " ") //Store the full line for multi-lines cells
+ previousLine[y] = strings.TrimRight(strings.Join(columns[y], " ")," ") //Store the full line for multi-lines cells
}
//Returns the newly added line and wether or not a border should be displayed above.
return previousLine, displayCellBorder
diff --git a/vendor/jaytaylor.com/html2text/LICENSE b/vendor/jaytaylor.com/html2text/LICENSE
deleted file mode 100644
index 24dc4ab..0000000
--- a/vendor/jaytaylor.com/html2text/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Jay Taylor
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
diff --git a/vendor/jaytaylor.com/html2text/README.md b/vendor/jaytaylor.com/html2text/README.md
deleted file mode 100644
index 6b2494e..0000000
--- a/vendor/jaytaylor.com/html2text/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-# html2text
-
-[![Documentation](https://godoc.org/github.com/jaytaylor/html2text?status.svg)](https://godoc.org/github.com/jaytaylor/html2text)
-[![Build Status](https://travis-ci.org/jaytaylor/html2text.svg?branch=master)](https://travis-ci.org/jaytaylor/html2text)
-[![Report Card](https://goreportcard.com/badge/github.com/jaytaylor/html2text)](https://goreportcard.com/report/github.com/jaytaylor/html2text)
-
-### Converts HTML into text of the markdown-flavored variety
-
-
-## Introduction
-
-Ensure your emails are readable by all!
-
-Turns HTML into raw text, useful for sending fancy HTML emails with an equivalently nicely formatted TXT document as a fallback (e.g. for people who don't allow HTML emails or have other display issues).
-
-html2text is a simple golang package for rendering HTML into plaintext.
-
-There are still lots of improvements to be had, but FWIW this has worked fine for my [basic] HTML-2-text needs.
-
-It requires go 1.x or newer ;)
-
-
-## Download the package
-
-```bash
-go get jaytaylor.com/html2text
-```
-
-## Example usage
-
-```go
-package main
-
-import (
- "fmt"
-
- "jaytaylor.com/html2text"
-)
-
-func main() {
- inputHTML := `
-
-