Compare commits
10 Commits
e1d454085a
...
3e9f230b1f
Author | SHA1 | Date |
---|---|---|
Erik Winter | 3e9f230b1f | |
Erik Winter | efce084c40 | |
Erik Winter | f85de95891 | |
Erik Winter | 16cbb646d3 | |
Erik Winter | 3c3ea3c767 | |
Erik Winter | f744089b62 | |
Erik Winter | 315c1405e8 | |
Erik Winter | 969230f461 | |
Erik Winter | 49ac666c00 | |
Erik Winter | 04244d682a |
|
@ -0,0 +1,55 @@
|
|||
= README.adoc
|
||||
2022-04-06
|
||||
|
||||
The beginnings of a parser for the https://asciidoc-py.github.io/index.html[Asciidoc] markup language.
|
||||
|
||||
== Example
|
||||
|
||||
https://go.dev/play/p/hF2wn_GdkBK[Run the snippet below on the Go Playground]
|
||||
|
||||
----
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.ewintr.nl/adoc"
|
||||
)
|
||||
|
||||
func main() {
|
||||
sourceDoc := `= This is the title
|
||||
|
||||
And this is the first paragraph. With some text. Lists are supported too:
|
||||
|
||||
* Item 1
|
||||
* Item 2
|
||||
* Item 3
|
||||
|
||||
And we also have things like *bold* and _italic_.`
|
||||
|
||||
par := adoc.NewParser(strings.NewReader(sourceDoc))
|
||||
doc := par.Parse()
|
||||
|
||||
htmlDoc := adoc.NewHTMLFormatter().Format(doc)
|
||||
fmt.Println(htmlDoc)
|
||||
|
||||
// output:
|
||||
//
|
||||
// <!DOCTYPE html>
|
||||
// <html>
|
||||
// <head>
|
||||
// <title>This is the title</title>
|
||||
// </head>
|
||||
// <body>
|
||||
// <p>And this is the first paragraph. With some text. Lists are supported too:</p>
|
||||
// <ul>
|
||||
// <li>Item 1</li>
|
||||
// <li>Item 2</li>
|
||||
// <li>Item 3</li>
|
||||
// </ul>
|
||||
// <p>And we also have things like <strong>bold</strong> and <em>italic</em>.</p>
|
||||
// </html>
|
||||
}
|
||||
----
|
||||
|
34
adoc.go
34
adoc.go
|
@ -1,23 +1,29 @@
|
|||
package adoc
|
||||
|
||||
import (
|
||||
"time"
|
||||
"io"
|
||||
|
||||
"ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/formatter"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
)
|
||||
|
||||
type ADoc struct {
|
||||
Title string
|
||||
Attributes map[string]string
|
||||
Author string
|
||||
Path string
|
||||
Date time.Time
|
||||
Content []element.Element
|
||||
func NewDocument() *document.Document {
|
||||
return document.New()
|
||||
}
|
||||
|
||||
func New() *ADoc {
|
||||
return &ADoc{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{},
|
||||
}
|
||||
func NewParser(reader io.Reader) *parser.Parser {
|
||||
return parser.New(reader)
|
||||
}
|
||||
|
||||
func NewTextFormatter() *formatter.Text {
|
||||
return formatter.NewText()
|
||||
}
|
||||
|
||||
func NewAsciiDocFormatter() *formatter.AsciiDoc {
|
||||
return formatter.NewAsciiDoc()
|
||||
}
|
||||
|
||||
func NewHTMLFormatter() *formatter.HTML {
|
||||
return formatter.NewHTML()
|
||||
}
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
= Implemented markup elements
|
||||
2022-12-20
|
||||
|
||||
== Headers
|
||||
|
||||
A header consists of the title of the post and various fields of metadata. It looks like this:
|
||||
|
||||
----
|
||||
= An Example Document
|
||||
Erik Winter <info@erikwinter.nl>
|
||||
2020-12-01
|
||||
:key1: value 1
|
||||
:key2: value 2
|
||||
|
||||
----
|
||||
|
||||
=== Subtitle and Subsubtitle
|
||||
|
||||
----
|
||||
== A Subtitle
|
||||
|
||||
== As SubSubTitle
|
||||
----
|
||||
|
||||
=== List
|
||||
|
||||
----
|
||||
* List item one
|
||||
* List item two
|
||||
* List item three
|
||||
----
|
||||
|
||||
=== Code Block
|
||||
|
||||
----
|
||||
----
|
||||
func (d *Dummy) DoSomething() string {
|
||||
return “No. I don’t want to.”
|
||||
}
|
||||
|
||||
func (d *Dummy) SudoDoSomething() string {
|
||||
return “Ok. If you insist, I’ll put my objections aside for a moment.”
|
||||
}
|
||||
----
|
||||
----
|
||||
|
||||
=== Paragraph
|
||||
|
||||
A paragraph is a line of text that gets parsed to find inline elements.
|
||||
|
||||
== Inline Elements
|
||||
|
||||
Currently the following types are recognized:
|
||||
|
||||
* Strong and emphasis
|
||||
* Link
|
||||
* Inline code
|
||||
|
||||
=== Strong and Emphasis
|
||||
|
||||
----
|
||||
a text with some *strong* words, that I’d like to _emphasize_.
|
||||
----
|
||||
|
||||
It is possible to combine the two for the same text.
|
||||
|
||||
=== Link
|
||||
|
||||
----
|
||||
Check out this https://erikwinter.nl/[awesome website] now!
|
||||
----
|
||||
|
||||
Whatever is between the opening bracket and the first space before that is taken as URL, so both absolute and relative links without domain are possible.
|
||||
|
||||
=== Inline Code
|
||||
|
||||
----
|
||||
Some text with `code` in it.
|
||||
----
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package document
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"code.ewintr.nl/adoc/element"
|
||||
)
|
||||
|
||||
type Document struct {
|
||||
Title string
|
||||
Attributes map[string]string
|
||||
Author string
|
||||
Date time.Time
|
||||
Content []element.Element
|
||||
}
|
||||
|
||||
func New() *Document {
|
||||
return &Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{},
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package element
|
||||
|
||||
import (
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type CodeBlock []Element
|
||||
|
|
|
@ -4,23 +4,23 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestCodeBlock(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
input string
|
||||
exp *adoc.ADoc
|
||||
exp *document.Document
|
||||
}{
|
||||
{
|
||||
name: "empty",
|
||||
input: `----
|
||||
----`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{element.CodeBlock{}},
|
||||
},
|
||||
|
@ -32,7 +32,7 @@ code
|
|||
|
||||
more
|
||||
----`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{element.CodeBlock{
|
||||
element.Word("code"),
|
||||
|
@ -48,7 +48,7 @@ more
|
|||
code
|
||||
----
|
||||
`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{element.CodeBlock{
|
||||
element.Word("code"),
|
||||
|
@ -63,7 +63,7 @@ code
|
|||
|
||||
more
|
||||
`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{
|
||||
element.Paragraph{[]element.Element{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package element
|
||||
|
||||
import "ewintr.nl/adoc/token"
|
||||
import "code.ewintr.nl/adoc/token"
|
||||
|
||||
type Element interface {
|
||||
Text() string
|
||||
|
|
|
@ -3,7 +3,7 @@ package element
|
|||
import (
|
||||
"time"
|
||||
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type Header struct {
|
||||
|
|
|
@ -5,22 +5,22 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestHeader(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
input string
|
||||
exp *adoc.ADoc
|
||||
exp *document.Document
|
||||
}{
|
||||
{
|
||||
name: "just title",
|
||||
input: "= Title",
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Title: "Title",
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{},
|
||||
|
@ -29,7 +29,7 @@ func TestHeader(t *testing.T) {
|
|||
{
|
||||
name: "empty title",
|
||||
input: "= ",
|
||||
exp: adoc.New(),
|
||||
exp: document.New(),
|
||||
},
|
||||
{
|
||||
name: "full header",
|
||||
|
@ -40,7 +40,7 @@ Author Name
|
|||
:key2: value2
|
||||
|
||||
First paragraph`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Title: "Title with words",
|
||||
Date: time.Date(2022, time.Month(3), 4, 0, 0, 0, 0, time.UTC),
|
||||
Author: "Author Name",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package element
|
||||
|
||||
import (
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type Link struct {
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestLink(t *testing.T) {
|
||||
|
@ -49,7 +49,7 @@ func TestLink(t *testing.T) {
|
|||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
par := parser.New(strings.NewReader(tc.input))
|
||||
exp := &adoc.ADoc{
|
||||
exp := &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: tc.exp,
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package element
|
||||
|
||||
import (
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type List []ListItem
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestList(t *testing.T) {
|
||||
|
@ -69,7 +69,7 @@ and some text`,
|
|||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
par := parser.New(strings.NewReader(tc.input))
|
||||
exp := &adoc.ADoc{
|
||||
exp := &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: tc.exp,
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package element
|
||||
|
||||
import (
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type ListItem []Element
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package element
|
||||
|
||||
import (
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type Paragraph struct {
|
||||
|
|
|
@ -4,22 +4,22 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestParagraph(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
input string
|
||||
exp *adoc.ADoc
|
||||
exp *document.Document
|
||||
}{
|
||||
{
|
||||
name: "single paragraph",
|
||||
input: "some text",
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{
|
||||
element.Paragraph{Elements: []element.Element{
|
||||
|
@ -36,7 +36,7 @@ func TestParagraph(t *testing.T) {
|
|||
paragraph one
|
||||
|
||||
paragraph two`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Title: "Title",
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{
|
||||
|
@ -61,7 +61,7 @@ two
|
|||
|
||||
three
|
||||
`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{
|
||||
element.Paragraph{Elements: []element.Element{element.Word("one")}},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package element
|
||||
|
||||
import "ewintr.nl/adoc/token"
|
||||
import "code.ewintr.nl/adoc/token"
|
||||
|
||||
type Word string
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package element
|
||||
|
||||
import "ewintr.nl/adoc/token"
|
||||
import "code.ewintr.nl/adoc/token"
|
||||
|
||||
type Strong []Element
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestStyles(t *testing.T) {
|
||||
|
@ -93,7 +93,7 @@ func TestStyles(t *testing.T) {
|
|||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
par := parser.New(strings.NewReader(tc.input))
|
||||
exp := &adoc.ADoc{
|
||||
exp := &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: tc.exp,
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package element
|
||||
|
||||
import "ewintr.nl/adoc/token"
|
||||
import "code.ewintr.nl/adoc/token"
|
||||
|
||||
type SubTitle string
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestSubTitle(t *testing.T) {
|
||||
|
@ -38,7 +38,7 @@ func TestSubTitle(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
exp := &adoc.ADoc{
|
||||
exp := &document.Document{
|
||||
Attributes: map[string]string{},
|
||||
Content: tc.exp,
|
||||
}
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
package format
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/go-kit/slugify"
|
||||
)
|
||||
|
||||
const pageTemplate = `<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>%s</title>
|
||||
</head>
|
||||
<body>
|
||||
%s</body>
|
||||
</html>
|
||||
`
|
||||
|
||||
func HTML(doc *adoc.ADoc) string {
|
||||
return fmt.Sprintf(pageTemplate, html.EscapeString(doc.Title), HTMLFragment(doc.Content...))
|
||||
}
|
||||
|
||||
func HTMLFragment(els ...element.Element) string {
|
||||
var html string
|
||||
for _, el := range els {
|
||||
html += htmlElement(el)
|
||||
}
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
func htmlElement(el element.Element) string {
|
||||
switch v := el.(type) {
|
||||
case element.SubTitle:
|
||||
return fmt.Sprintf("<h2 id=%q>%s</h2>\n", slugify.Slugify(v.Text()), html.EscapeString(v.Text()))
|
||||
case element.SubSubTitle:
|
||||
return fmt.Sprintf("<h3 id=%q>%s</h3>\n", slugify.Slugify(v.Text()), html.EscapeString(v.Text()))
|
||||
case element.List:
|
||||
var items []element.Element
|
||||
for _, i := range v {
|
||||
items = append(items, i)
|
||||
}
|
||||
return fmt.Sprintf("<ul>\n%s</ul>\n", HTMLFragment(items...))
|
||||
case element.ListItem:
|
||||
return fmt.Sprintf("<li>%s</li>\n", HTMLFragment(v...))
|
||||
case element.CodeBlock:
|
||||
return fmt.Sprintf("<pre><code>%s</code></pre>", v.Text())
|
||||
case element.Paragraph:
|
||||
return fmt.Sprintf("<p>%s</p>\n", HTMLFragment(v.Elements...))
|
||||
case element.Strong:
|
||||
return fmt.Sprintf("<strong>%s</strong>", HTMLFragment(v...))
|
||||
case element.Emphasis:
|
||||
return fmt.Sprintf("<em>%s</em>", HTMLFragment(v...))
|
||||
case element.Code:
|
||||
return fmt.Sprintf("<code>%s</code>", HTMLFragment(v...))
|
||||
case element.Link:
|
||||
return fmt.Sprintf("<a href=%q>%s</a>", v.URL, html.EscapeString(v.Title))
|
||||
case element.Word:
|
||||
return html.EscapeString(v.Text())
|
||||
case element.WhiteSpace:
|
||||
return " "
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package format
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
)
|
||||
|
||||
func Text(doc *adoc.ADoc) string {
|
||||
txt := fmt.Sprintf("%s\n\n", doc.Title)
|
||||
for _, el := range doc.Content {
|
||||
txt += fmt.Sprintf("%s\n\n", el.Text())
|
||||
}
|
||||
|
||||
return txt
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package formatter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
)
|
||||
|
||||
type AsciiDoc struct{}
|
||||
|
||||
func NewAsciiDoc() *AsciiDoc {
|
||||
return &AsciiDoc{}
|
||||
}
|
||||
|
||||
func (ad *AsciiDoc) Format(doc *document.Document) string {
|
||||
return fmt.Sprintf("%s\n%s", asciiDocHeader(doc), ad.FormatFragments(doc.Content...))
|
||||
}
|
||||
|
||||
func asciiDocHeader(doc *document.Document) string {
|
||||
header := fmt.Sprintf("= %s\n", doc.Title)
|
||||
if doc.Author != "" {
|
||||
header += fmt.Sprintf("%s\n", doc.Author)
|
||||
}
|
||||
if !doc.Date.IsZero() {
|
||||
header += fmt.Sprintf("%s\n", doc.Date.Format("2006-01-02"))
|
||||
}
|
||||
for k, v := range doc.Attributes {
|
||||
header += fmt.Sprintf(":%s: %s\n", k, v)
|
||||
}
|
||||
|
||||
return header
|
||||
}
|
||||
|
||||
func (ad *AsciiDoc) FormatFragments(els ...element.Element) string {
|
||||
var asciiDoc string
|
||||
for _, el := range els {
|
||||
asciiDoc += ad.asciiDocElement(el)
|
||||
}
|
||||
|
||||
return asciiDoc
|
||||
}
|
||||
|
||||
func (ad *AsciiDoc) asciiDocElement(el element.Element) string {
|
||||
switch v := el.(type) {
|
||||
case element.SubTitle:
|
||||
return fmt.Sprintf("== %s\n\n", v.Text())
|
||||
case element.SubSubTitle:
|
||||
return fmt.Sprintf("=== %s\n\n", v.Text())
|
||||
case element.List:
|
||||
var items []element.Element
|
||||
for _, i := range v {
|
||||
items = append(items, i)
|
||||
}
|
||||
return fmt.Sprintf("%s\n", ad.FormatFragments(items...))
|
||||
case element.ListItem:
|
||||
return fmt.Sprintf("* %s\n", ad.FormatFragments(v...))
|
||||
case element.CodeBlock:
|
||||
return fmt.Sprintf("----\n%s\n----\n\n", v.Text())
|
||||
case element.Paragraph:
|
||||
return fmt.Sprintf("%s\n\n", ad.FormatFragments(v.Elements...))
|
||||
case element.Strong:
|
||||
return fmt.Sprintf("*%s*", ad.FormatFragments(v...))
|
||||
case element.Emphasis:
|
||||
return fmt.Sprintf("_%s_", ad.FormatFragments(v...))
|
||||
case element.Code:
|
||||
return fmt.Sprintf("`%s`", ad.FormatFragments(v...))
|
||||
case element.Link:
|
||||
return fmt.Sprintf("%s[%s]", v.URL, v.Title)
|
||||
case element.Word:
|
||||
return v.Text()
|
||||
case element.WhiteSpace:
|
||||
return " "
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
package formatter_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/formatter"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestAsciiDoc(t *testing.T) {
|
||||
input := &document.Document{
|
||||
Title: "A Title",
|
||||
Author: "Author",
|
||||
Date: time.Date(2022, time.Month(6), 11, 0, 0, 0, 0, time.UTC),
|
||||
Attributes: map[string]string{
|
||||
"key1": "value 1",
|
||||
"key2": "value 2",
|
||||
},
|
||||
Content: []element.Element{
|
||||
element.Paragraph{
|
||||
Elements: []element.Element{
|
||||
element.Word("some"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("text"),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
exp := `= A Title
|
||||
Author
|
||||
2022-06-11
|
||||
:key1: value 1
|
||||
:key2: value 2
|
||||
|
||||
some text
|
||||
|
||||
`
|
||||
|
||||
test.Equals(t, exp, formatter.NewAsciiDoc().Format(input))
|
||||
}
|
||||
|
||||
func TestAsciiDocFragment(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
input element.Element
|
||||
exp string
|
||||
}{
|
||||
{
|
||||
name: "whitespace",
|
||||
input: element.WhiteSpace("\n"),
|
||||
exp: " ",
|
||||
},
|
||||
{
|
||||
name: "word",
|
||||
input: element.Word("word"),
|
||||
exp: "word",
|
||||
},
|
||||
{
|
||||
name: "pararaphs",
|
||||
input: element.Paragraph{
|
||||
Elements: []element.Element{
|
||||
element.Word("a"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("word"),
|
||||
},
|
||||
},
|
||||
exp: "a word\n\n",
|
||||
},
|
||||
{
|
||||
name: "strong",
|
||||
input: element.Strong{
|
||||
element.Word("something"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("strong"),
|
||||
},
|
||||
exp: "*something strong*",
|
||||
},
|
||||
{
|
||||
name: "nested",
|
||||
input: element.Paragraph{
|
||||
Elements: []element.Element{
|
||||
element.Word("normal"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("text"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Strong{
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("and"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("strong"),
|
||||
},
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("too"),
|
||||
},
|
||||
},
|
||||
exp: "normal text * and strong* too\n\n",
|
||||
},
|
||||
{
|
||||
name: "emphasis",
|
||||
input: element.Emphasis{
|
||||
element.Word("yes"),
|
||||
},
|
||||
exp: "_yes_",
|
||||
},
|
||||
{
|
||||
name: "code",
|
||||
input: element.Code{
|
||||
element.Word("simple"),
|
||||
},
|
||||
exp: "`simple`",
|
||||
},
|
||||
{
|
||||
name: "link",
|
||||
input: element.Link{
|
||||
URL: "http://example.com",
|
||||
Title: "an example",
|
||||
},
|
||||
exp: `http://example.com[an example]`,
|
||||
},
|
||||
{
|
||||
name: "list",
|
||||
input: element.List{
|
||||
element.ListItem{
|
||||
element.Word("item"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("1"),
|
||||
},
|
||||
element.ListItem{
|
||||
element.Word("item"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("2"),
|
||||
},
|
||||
},
|
||||
exp: `* item 1
|
||||
* item 2
|
||||
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "code block",
|
||||
input: element.CodeBlock{
|
||||
element.Word("some"),
|
||||
element.WhiteSpace(" "),
|
||||
element.Word("text"),
|
||||
element.WhiteSpace("\n"),
|
||||
element.Word("<p>with</p>"),
|
||||
element.WhiteSpace("\t"),
|
||||
element.Word("formatting"),
|
||||
},
|
||||
exp: `----
|
||||
some text
|
||||
<p>with</p> formatting
|
||||
----
|
||||
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "subtitle",
|
||||
input: element.SubTitle("a subtitle"),
|
||||
exp: "== a subtitle\n\n",
|
||||
},
|
||||
{
|
||||
name: "subsubtitle",
|
||||
input: element.SubSubTitle("a subsubtitle"),
|
||||
exp: "=== a subsubtitle\n\n",
|
||||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
test.Equals(t, tc.exp, formatter.NewAsciiDoc().FormatFragments(tc.input))
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package formatter
|
||||
|
||||
import (
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
)
|
||||
|
||||
type Formatter interface {
|
||||
Format(doc *document.Document) string
|
||||
FormatFragments(els ...element.Element) string
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package formatter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/go-kit/slugify"
|
||||
)
|
||||
|
||||
const htmlPageTemplate = `<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>%s</title>
|
||||
</head>
|
||||
<body>
|
||||
%s</body>
|
||||
</html>
|
||||
`
|
||||
|
||||
type HTML struct{}
|
||||
|
||||
func NewHTML() *HTML {
|
||||
return &HTML{}
|
||||
}
|
||||
|
||||
func (h *HTML) Format(doc *document.Document) string {
|
||||
return fmt.Sprintf(htmlPageTemplate, html.EscapeString(doc.Title), h.FormatFragments(doc.Content...))
|
||||
}
|
||||
|
||||
func (h *HTML) FormatFragments(els ...element.Element) string {
|
||||
var html string
|
||||
for _, el := range els {
|
||||
html += h.htmlElement(el)
|
||||
}
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
func (h *HTML) htmlElement(el element.Element) string {
|
||||
switch v := el.(type) {
|
||||
case element.SubTitle:
|
||||
return fmt.Sprintf("<h2 id=%q>%s</h2>\n", slugify.Slugify(v.Text()), html.EscapeString(v.Text()))
|
||||
case element.SubSubTitle:
|
||||
return fmt.Sprintf("<h3 id=%q>%s</h3>\n", slugify.Slugify(v.Text()), html.EscapeString(v.Text()))
|
||||
case element.List:
|
||||
var items []element.Element
|
||||
for _, i := range v {
|
||||
items = append(items, i)
|
||||
}
|
||||
return fmt.Sprintf("<ul>\n%s</ul>\n", h.FormatFragments(items...))
|
||||
case element.ListItem:
|
||||
return fmt.Sprintf("<li>%s</li>\n", h.FormatFragments(v...))
|
||||
case element.CodeBlock:
|
||||
return fmt.Sprintf("<pre><code>%s</code></pre>", html.EscapeString(v.Text()))
|
||||
case element.Paragraph:
|
||||
return fmt.Sprintf("<p>%s</p>\n", h.FormatFragments(v.Elements...))
|
||||
case element.Strong:
|
||||
return fmt.Sprintf("<strong>%s</strong>", h.FormatFragments(v...))
|
||||
case element.Emphasis:
|
||||
return fmt.Sprintf("<em>%s</em>", h.FormatFragments(v...))
|
||||
case element.Code:
|
||||
return fmt.Sprintf("<code>%s</code>", h.FormatFragments(v...))
|
||||
case element.Link:
|
||||
return fmt.Sprintf("<a href=%q>%s</a>", v.URL, html.EscapeString(v.Title))
|
||||
case element.Word:
|
||||
return html.EscapeString(v.Text())
|
||||
case element.WhiteSpace:
|
||||
return " "
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package format_test
|
||||
package formatter_test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/format"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/formatter"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestHTML(t *testing.T) {
|
||||
|
@ -29,7 +29,7 @@ With some text.`
|
|||
</html>
|
||||
`
|
||||
doc := parser.New(strings.NewReader(input)).Parse()
|
||||
test.Equals(t, exp, format.HTML(doc))
|
||||
test.Equals(t, exp, formatter.NewHTML().Format(doc))
|
||||
}
|
||||
|
||||
func TestHTMLFragment(t *testing.T) {
|
||||
|
@ -141,12 +141,12 @@ func TestHTMLFragment(t *testing.T) {
|
|||
element.WhiteSpace(" "),
|
||||
element.Word("text"),
|
||||
element.WhiteSpace("\n"),
|
||||
element.Word("with"),
|
||||
element.Word("<p>with</p>"),
|
||||
element.WhiteSpace("\t"),
|
||||
element.Word("formatting"),
|
||||
},
|
||||
exp: `<pre><code>some text
|
||||
with formatting</code></pre>`,
|
||||
<p>with</p> formatting</code></pre>`,
|
||||
},
|
||||
{
|
||||
name: "subtitle",
|
||||
|
@ -160,7 +160,7 @@ with formatting</code></pre>`,
|
|||
},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
test.Equals(t, tc.exp, format.HTMLFragment(tc.input))
|
||||
test.Equals(t, tc.exp, formatter.NewHTML().FormatFragments(tc.input))
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package formatter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
)
|
||||
|
||||
type Text struct{}
|
||||
|
||||
func NewText() *Text {
|
||||
return &Text{}
|
||||
}
|
||||
|
||||
func (t *Text) Format(doc *document.Document) string {
|
||||
txt := fmt.Sprintf("%s\n\n", doc.Title)
|
||||
txt += t.FormatFragments(doc.Content...)
|
||||
return txt
|
||||
}
|
||||
|
||||
func (t *Text) FormatFragments(els ...element.Element) string {
|
||||
var text string
|
||||
for _, el := range els {
|
||||
text += fmt.Sprintf("%s\n\n", el.Text())
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package format_test
|
||||
package formatter_test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc/format"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/formatter"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestText(t *testing.T) {
|
||||
|
@ -25,5 +25,5 @@ With some text.
|
|||
`
|
||||
|
||||
doc := parser.New(strings.NewReader(input)).Parse()
|
||||
test.Equals(t, exp, format.Text(doc))
|
||||
test.Equals(t, exp, formatter.NewText().Format(doc))
|
||||
}
|
8
go.mod
8
go.mod
|
@ -1,5 +1,7 @@
|
|||
module ewintr.nl/adoc
|
||||
module code.ewintr.nl/adoc
|
||||
|
||||
go 1.16
|
||||
go 1.21.5
|
||||
|
||||
require ewintr.nl/go-kit v0.1.0
|
||||
require code.ewintr.nl/go-kit v0.0.0-20240308074309-a1328c3c44c6
|
||||
|
||||
require golang.org/x/text v0.14.0 // indirect
|
||||
|
|
357
go.sum
357
go.sum
|
@ -1,353 +1,4 @@
|
|||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
ewintr.nl/go-kit v0.1.0 h1:wxusyxmVgwy8QD3dCOqtr6PaH0n8ZpZl3KEdn3L+lhU=
|
||||
ewintr.nl/go-kit v0.1.0/go.mod h1:mIlMyAvKBuuQSQuX5f1+1gYZ02vz6xRFGN9wiO0HfzI=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
|
||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
|
||||
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
|
||||
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
|
||||
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
|
||||
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
|
||||
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
|
||||
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
|
||||
github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo=
|
||||
github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
|
||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
|
||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
|
||||
github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU=
|
||||
github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k=
|
||||
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
|
||||
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk=
|
||||
github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis=
|
||||
github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74=
|
||||
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA=
|
||||
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
|
||||
github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
|
||||
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
|
||||
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
|
||||
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
|
||||
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
|
||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
|
||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
|
||||
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
|
||||
code.ewintr.nl/go-kit v0.0.0-20240308074309-a1328c3c44c6 h1:qZwAicZOd18o9qWCU3pSj/QnrSNLCAMAOPJvyLgBQ0U=
|
||||
code.ewintr.nl/go-kit v0.0.0-20240308074309-a1328c3c44c6/go.mod h1:Yk8Mdn1f4/L9tcymurtItqevVkac6P9ljh2Sd3T+FS8=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
|
|
|
@ -3,13 +3,13 @@ package parser
|
|||
import (
|
||||
"io"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
)
|
||||
|
||||
type Parser struct {
|
||||
doc *adoc.ADoc
|
||||
doc *document.Document
|
||||
tr *token.TokenReader
|
||||
els []element.Element
|
||||
}
|
||||
|
@ -21,13 +21,13 @@ func New(reader io.Reader) *Parser {
|
|||
|
||||
func NewParserFromChannel(toks chan token.Token) *Parser {
|
||||
return &Parser{
|
||||
doc: adoc.New(),
|
||||
doc: document.New(),
|
||||
tr: token.NewTokenReader(toks),
|
||||
els: []element.Element{},
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Parser) Parse() *adoc.ADoc {
|
||||
func (p *Parser) Parse() *document.Document {
|
||||
result, ok := element.NewHeaderFromTokens(p.tr)
|
||||
if ok {
|
||||
if h, ok := result.Element.(element.Header); ok {
|
||||
|
|
|
@ -4,21 +4,21 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"ewintr.nl/adoc"
|
||||
"ewintr.nl/adoc/element"
|
||||
"ewintr.nl/adoc/parser"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/document"
|
||||
"code.ewintr.nl/adoc/element"
|
||||
"code.ewintr.nl/adoc/parser"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestParser(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
input string
|
||||
exp *adoc.ADoc
|
||||
exp *document.Document
|
||||
}{
|
||||
{
|
||||
name: "empty",
|
||||
exp: adoc.New(),
|
||||
exp: document.New(),
|
||||
},
|
||||
{
|
||||
name: "codeblock paragraph edge",
|
||||
|
@ -29,7 +29,7 @@ a code block
|
|||
----
|
||||
|
||||
And then some text`,
|
||||
exp: &adoc.ADoc{
|
||||
exp: &document.Document{
|
||||
Title: "some title",
|
||||
Attributes: map[string]string{},
|
||||
Content: []element.Element{
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"ewintr.nl/adoc/token"
|
||||
"ewintr.nl/go-kit/test"
|
||||
"code.ewintr.nl/adoc/token"
|
||||
"code.ewintr.nl/go-kit/test"
|
||||
)
|
||||
|
||||
func TestLexer(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue