diff --git a/Gopkg.lock b/Gopkg.lock
index a0357ad..fc4304d 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -11,43 +11,37 @@
branch = "master"
name = "github.com/beorn7/perks"
packages = ["quantile"]
- revision = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"
+ revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
[[projects]]
- branch = "master"
name = "github.com/flosch/pongo2"
packages = ["."]
- revision = "1f4be1efe3b3529b7e58861f75d70120a9567dc4"
+ revision = "5e81b817a0c48c1c57cdf1a9056cf76bdee02ca9"
+ version = "v3.0"
[[projects]]
- branch = "master"
name = "github.com/golang/protobuf"
packages = ["proto"]
- revision = "1643683e1b54a9e88ad26d98f81400c8c9d9f4f9"
+ revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265"
+ version = "v1.1.0"
[[projects]]
name = "github.com/gorilla/context"
packages = ["."]
- revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a"
- version = "v1.1"
+ revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"
+ version = "v1.1.1"
[[projects]]
name = "github.com/gorilla/mux"
packages = ["."]
- revision = "24fca303ac6da784b9e8269f724ddeb0b2eea5e7"
- version = "v1.5.0"
-
-[[projects]]
- branch = "master"
- name = "github.com/juju/errors"
- packages = ["."]
- revision = "c7d06af17c68cd34c835053720b21f6549d9b0ee"
+ revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf"
+ version = "v1.6.2"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
packages = ["pbutil"]
- revision = "3247c84500bff8d9fb6d579d800f20b3e091582c"
- version = "v1.0.0"
+ revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c"
+ version = "v1.0.1"
[[projects]]
name = "github.com/prometheus/client_golang"
@@ -59,65 +53,77 @@
branch = "master"
name = "github.com/prometheus/client_model"
packages = ["go"]
- revision = "6f3806018612930941127f2a7c6c453ba2c527d2"
+ revision = "99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
- packages = ["expfmt","internal/bitbucket.org/ww/goautoneg","model"]
- revision = "e3fb1a1acd7605367a2b378bc2e2f893c05174b7"
+ packages = [
+ "expfmt",
+ "internal/bitbucket.org/ww/goautoneg",
+ "model"
+ ]
+ revision = "7600349dcfe1abd18d72d3a1770870d9800a7801"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
- packages = [".","xfs"]
- revision = "a6e9df898b1336106c743392c48ee0b71f5c4efa"
+ packages = [
+ ".",
+ "internal/util",
+ "nfs",
+ "xfs"
+ ]
+ revision = "94663424ae5ae9856b40a9f170762b4197024661"
[[projects]]
name = "github.com/robfig/cron"
packages = ["."]
- revision = "b024fc5ea0e34bc3f83d9941c8d60b0622bfaca4"
- version = "v1"
+ revision = "b41be1df696709bb6395fe435af20370037c0b4c"
+ version = "v1.1"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
- revision = "f006c2ac4710855cf0f916dd6b77acf6b048dc6e"
- version = "v1.0.3"
+ revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc"
+ version = "v1.0.5"
[[projects]]
name = "github.com/spf13/pflag"
packages = ["."]
- revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66"
- version = "v1.0.0"
+ revision = "583c0c0531f06d5278b7d917446061adc344b5cd"
+ version = "v1.0.1"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["ssh/terminal"]
- revision = "bd6f299fb381e4c3393d1c4b1f0b94f5e77650c8"
+ revision = "df8d4716b3472e4a531c33cedbe537dae921a1a9"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
- packages = ["unix","windows"]
- revision = "8eb05f94d449fdf134ec24630ce69ada5b469c1c"
+ packages = [
+ "unix",
+ "windows"
+ ]
+ revision = "c11f84a56e43e20a78cee75a7c034031ecf57d1f"
[[projects]]
branch = "v2"
name = "gopkg.in/validator.v2"
packages = ["."]
- revision = "460c83432a98c35224a6fe352acf8b23e067ad06"
+ revision = "135c24b11c19e52befcae2ec3fca5d9b78c4e98e"
[[projects]]
- branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
- revision = "eb3733d160e74a9c7e442f435eb3bea458e1d19f"
+ revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
+ version = "v2.2.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
- inputs-digest = "f88f786b9ff5e99b5589aea171923fd8d9dcef123a4d6be68d7659b923e8dc1e"
+ inputs-digest = "9e9921ed070369ec5c66299d9403b1d7dd184332dbf7f7e36c5d1ff493b88216"
solver-name = "gps-cdcl"
solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
index 62974f7..9479b2a 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -1,7 +1,6 @@
-
# Gopkg.toml example
#
-# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
+# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
@@ -17,8 +16,13 @@
# source = "github.com/myfork/project2"
#
# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
+# name = "github.com/x/y"
+# version = "2.4.0"
+#
+# [prune]
+# non-go = false
+# go-tests = true
+# unused-packages = true
[[constraint]]
@@ -27,17 +31,24 @@
[[constraint]]
name = "github.com/flosch/pongo2"
- branch = "master"
+ version = "3.0.0"
[[constraint]]
name = "github.com/gorilla/mux"
+ version = "1.6.2"
[[constraint]]
name = "github.com/prometheus/client_golang"
+ version = "0.8.0"
[[constraint]]
name = "github.com/robfig/cron"
+ version = "1.1.0"
[[constraint]]
name = "github.com/sirupsen/logrus"
- version = "1.0.3"
+ version = "1.0.5"
+
+[prune]
+ go-tests = true
+ unused-packages = true
diff --git a/vendor/github.com/Luzifer/rconfig/bool_test.go b/vendor/github.com/Luzifer/rconfig/bool_test.go
deleted file mode 100644
index 11a6f4b..0000000
--- a/vendor/github.com/Luzifer/rconfig/bool_test.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package rconfig
-
-import (
- "os"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing bool parsing", func() {
- type t struct {
- Test1 bool `default:"true"`
- Test2 bool `default:"false" flag:"test2"`
- Test3 bool `default:"true" flag:"test3,t"`
- Test4 bool `flag:"test4"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--test2",
- "-t",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test1).To(Equal(true))
- Expect(cfg.Test2).To(Equal(true))
- Expect(cfg.Test3).To(Equal(true))
- Expect(cfg.Test4).To(Equal(false))
- })
-})
-
-var _ = Describe("Testing to set bool from ENV with default", func() {
- type t struct {
- Test1 bool `default:"true" env:"TEST1"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{}
- })
-
- JustBeforeEach(func() {
- os.Unsetenv("TEST1")
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test1).To(Equal(true))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/duration_test.go b/vendor/github.com/Luzifer/rconfig/duration_test.go
deleted file mode 100644
index 1ca95dc..0000000
--- a/vendor/github.com/Luzifer/rconfig/duration_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package rconfig
-
-import (
- "time"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Duration", func() {
- type t struct {
- Test time.Duration `flag:"duration"`
- TestS time.Duration `flag:"other-duration,o"`
- TestDef time.Duration `default:"30h"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--duration=23s", "-o", "45m",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test).To(Equal(23 * time.Second))
- Expect(cfg.TestS).To(Equal(45 * time.Minute))
-
- Expect(cfg.TestDef).To(Equal(30 * time.Hour))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/errors_test.go b/vendor/github.com/Luzifer/rconfig/errors_test.go
deleted file mode 100644
index 46db039..0000000
--- a/vendor/github.com/Luzifer/rconfig/errors_test.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package rconfig
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing errors", func() {
-
- It("should not accept string as int", func() {
- Expect(parse(&struct {
- A int `default:"a"`
- }{}, []string{})).To(HaveOccurred())
- })
-
- It("should not accept string as float", func() {
- Expect(parse(&struct {
- A float32 `default:"a"`
- }{}, []string{})).To(HaveOccurred())
- })
-
- It("should not accept string as uint", func() {
- Expect(parse(&struct {
- A uint `default:"a"`
- }{}, []string{})).To(HaveOccurred())
- })
-
- It("should not accept string as uint in sub-struct", func() {
- Expect(parse(&struct {
- B struct {
- A uint `default:"a"`
- }
- }{}, []string{})).To(HaveOccurred())
- })
-
- It("should not accept string slice as int slice", func() {
- Expect(parse(&struct {
- A []int `default:"a,bn"`
- }{}, []string{})).To(HaveOccurred())
- })
-
- It("should not accept variables not being pointers", func() {
- cfg := struct {
- A string `default:"a"`
- }{}
-
- Expect(parse(cfg, []string{})).To(HaveOccurred())
- })
-
- It("should not accept variables not being pointers to structs", func() {
- cfg := "test"
-
- Expect(parse(cfg, []string{})).To(HaveOccurred())
- })
-
-})
diff --git a/vendor/github.com/Luzifer/rconfig/example_test.go b/vendor/github.com/Luzifer/rconfig/example_test.go
deleted file mode 100644
index 0a65b2f..0000000
--- a/vendor/github.com/Luzifer/rconfig/example_test.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package rconfig
-
-import (
- "fmt"
- "os"
-)
-
-func ExampleParse() {
- // We're building an example configuration with a sub-struct to be filled
- // by the Parse command.
- config := struct {
- Username string `default:"unknown" flag:"user,u" description:"Your name"`
- Details struct {
- Age int `default:"25" flag:"age" description:"Your age"`
- }
- }{}
-
- // To have more relieable results we're setting os.Args to a known value.
- // In real-life use cases you wouldn't do this but parse the original
- // commandline arguments.
- os.Args = []string{
- "example",
- "--user=Luzifer",
- }
-
- Parse(&config)
-
- fmt.Printf("Hello %s, happy birthday for your %dth birthday.",
- config.Username,
- config.Details.Age)
-
- // You can also show an usage message for your user
- Usage()
-
- // Output:
- // Hello Luzifer, happy birthday for your 25th birthday.
-}
diff --git a/vendor/github.com/Luzifer/rconfig/float_test.go b/vendor/github.com/Luzifer/rconfig/float_test.go
deleted file mode 100644
index 4ec8a1e..0000000
--- a/vendor/github.com/Luzifer/rconfig/float_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package rconfig
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing float parsing", func() {
- type t struct {
- Test32 float32 `flag:"float32"`
- Test32P float32 `flag:"float32p,3"`
- Test64 float64 `flag:"float64"`
- Test64P float64 `flag:"float64p,6"`
- TestDef float32 `default:"66.256"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--float32=5.5", "-3", "6.6",
- "--float64=7.7", "-6", "8.8",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test32).To(Equal(float32(5.5)))
- Expect(cfg.Test32P).To(Equal(float32(6.6)))
- Expect(cfg.Test64).To(Equal(float64(7.7)))
- Expect(cfg.Test64P).To(Equal(float64(8.8)))
-
- Expect(cfg.TestDef).To(Equal(float32(66.256)))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/general_test.go b/vendor/github.com/Luzifer/rconfig/general_test.go
deleted file mode 100644
index e7f29b7..0000000
--- a/vendor/github.com/Luzifer/rconfig/general_test.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package rconfig
-
-import (
- "os"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing general parsing", func() {
- type t struct {
- Test string `default:"foo" env:"shell" flag:"shell" description:"Test"`
- Test2 string `default:"blub" env:"testvar" flag:"testvar,t" description:"Test"`
- DefaultFlag string `default:"goo"`
- SadFlag string
- }
-
- type tValidated struct {
- Test string `flag:"test" default:"" validate:"nonzero"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- Context("with defined arguments", func() {
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--shell=test23",
- "-t", "bla",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have parsed the expected values", func() {
- Expect(cfg.Test).To(Equal("test23"))
- Expect(cfg.Test2).To(Equal("bla"))
- Expect(cfg.SadFlag).To(Equal(""))
- Expect(cfg.DefaultFlag).To(Equal("goo"))
- })
- })
-
- Context("with no arguments", func() {
- BeforeEach(func() {
- cfg = t{}
- args = []string{}
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have used the default value", func() {
- Expect(cfg.Test).To(Equal("foo"))
- })
- })
-
- Context("with no arguments and set env", func() {
- BeforeEach(func() {
- cfg = t{}
- args = []string{}
- os.Setenv("shell", "test546")
- })
-
- AfterEach(func() {
- os.Unsetenv("shell")
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have used the value from env", func() {
- Expect(cfg.Test).To(Equal("test546"))
- })
- })
-
- Context("with additional arguments", func() {
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--shell=test23",
- "-t", "bla",
- "positional1", "positional2",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have parsed the expected values", func() {
- Expect(cfg.Test).To(Equal("test23"))
- Expect(cfg.Test2).To(Equal("bla"))
- Expect(cfg.SadFlag).To(Equal(""))
- Expect(cfg.DefaultFlag).To(Equal("goo"))
- })
- It("should have detected the positional arguments", func() {
- Expect(Args()).To(Equal([]string{"positional1", "positional2"}))
- })
- })
-
- Context("making use of the validator package", func() {
- var cfgValidated tValidated
-
- BeforeEach(func() {
- cfgValidated = tValidated{}
- args = []string{}
- })
-
- JustBeforeEach(func() {
- err = parseAndValidate(&cfgValidated, args)
- })
-
- It("should have errored", func() { Expect(err).To(HaveOccurred()) })
- })
-
-})
diff --git a/vendor/github.com/Luzifer/rconfig/int_test.go b/vendor/github.com/Luzifer/rconfig/int_test.go
deleted file mode 100644
index 2cc0022..0000000
--- a/vendor/github.com/Luzifer/rconfig/int_test.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package rconfig
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing int parsing", func() {
- type t struct {
- Test int `flag:"int"`
- TestP int `flag:"intp,i"`
- Test8 int8 `flag:"int8"`
- Test8P int8 `flag:"int8p,8"`
- Test32 int32 `flag:"int32"`
- Test32P int32 `flag:"int32p,3"`
- Test64 int64 `flag:"int64"`
- Test64P int64 `flag:"int64p,6"`
- TestDef int8 `default:"66"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--int=1", "-i", "2",
- "--int8=3", "-8", "4",
- "--int32=5", "-3", "6",
- "--int64=7", "-6", "8",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test).To(Equal(1))
- Expect(cfg.TestP).To(Equal(2))
- Expect(cfg.Test8).To(Equal(int8(3)))
- Expect(cfg.Test8P).To(Equal(int8(4)))
- Expect(cfg.Test32).To(Equal(int32(5)))
- Expect(cfg.Test32P).To(Equal(int32(6)))
- Expect(cfg.Test64).To(Equal(int64(7)))
- Expect(cfg.Test64P).To(Equal(int64(8)))
-
- Expect(cfg.TestDef).To(Equal(int8(66)))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/os-args_test.go b/vendor/github.com/Luzifer/rconfig/os-args_test.go
deleted file mode 100644
index eacee71..0000000
--- a/vendor/github.com/Luzifer/rconfig/os-args_test.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package rconfig_test
-
-import (
- "os"
-
- . "github.com/Luzifer/rconfig"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing os.Args", func() {
- type t struct {
- A string `default:"a" flag:"a"`
- }
-
- var (
- err error
- cfg t
- )
-
- JustBeforeEach(func() {
- err = Parse(&cfg)
- })
-
- Context("With only valid arguments", func() {
-
- BeforeEach(func() {
- cfg = t{}
- os.Args = []string{"--a=bar"}
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.A).To(Equal("bar"))
- })
-
- })
-
-})
diff --git a/vendor/github.com/Luzifer/rconfig/precedence_test.go b/vendor/github.com/Luzifer/rconfig/precedence_test.go
deleted file mode 100644
index 6d87ca0..0000000
--- a/vendor/github.com/Luzifer/rconfig/precedence_test.go
+++ /dev/null
@@ -1,87 +0,0 @@
-package rconfig
-
-import (
- "os"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Precedence", func() {
-
- type t struct {
- A int `default:"1" vardefault:"a" env:"a" flag:"avar,a" description:"a"`
- }
-
- var (
- err error
- cfg t
- args []string
- vardefaults map[string]string
- )
-
- JustBeforeEach(func() {
- cfg = t{}
- SetVariableDefaults(vardefaults)
- err = parse(&cfg, args)
- })
-
- Context("Provided: Flag, Env, Default, VarDefault", func() {
- BeforeEach(func() {
- args = []string{"-a", "5"}
- os.Setenv("a", "8")
- vardefaults = map[string]string{
- "a": "3",
- }
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have used the flag value", func() {
- Expect(cfg.A).To(Equal(5))
- })
- })
-
- Context("Provided: Env, Default, VarDefault", func() {
- BeforeEach(func() {
- args = []string{}
- os.Setenv("a", "8")
- vardefaults = map[string]string{
- "a": "3",
- }
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have used the env value", func() {
- Expect(cfg.A).To(Equal(8))
- })
- })
-
- Context("Provided: Default, VarDefault", func() {
- BeforeEach(func() {
- args = []string{}
- os.Unsetenv("a")
- vardefaults = map[string]string{
- "a": "3",
- }
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have used the vardefault value", func() {
- Expect(cfg.A).To(Equal(3))
- })
- })
-
- Context("Provided: Default", func() {
- BeforeEach(func() {
- args = []string{}
- os.Unsetenv("a")
- vardefaults = map[string]string{}
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have used the default value", func() {
- Expect(cfg.A).To(Equal(1))
- })
- })
-
-})
diff --git a/vendor/github.com/Luzifer/rconfig/rconfig_suite_test.go b/vendor/github.com/Luzifer/rconfig/rconfig_suite_test.go
deleted file mode 100644
index 72c9ce4..0000000
--- a/vendor/github.com/Luzifer/rconfig/rconfig_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package rconfig_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestRconfig(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Rconfig Suite")
-}
diff --git a/vendor/github.com/Luzifer/rconfig/slice_test.go b/vendor/github.com/Luzifer/rconfig/slice_test.go
deleted file mode 100644
index 7d9524e..0000000
--- a/vendor/github.com/Luzifer/rconfig/slice_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package rconfig
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing slices", func() {
- type t struct {
- Int []int `default:"1,2,3" flag:"int"`
- String []string `default:"a,b,c" flag:"string"`
- IntP []int `default:"1,2,3" flag:"intp,i"`
- StringP []string `default:"a,b,c" flag:"stringp,s"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--int=4,5", "-s", "hallo,welt",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values for int-slice", func() {
- Expect(len(cfg.Int)).To(Equal(2))
- Expect(cfg.Int).To(Equal([]int{4, 5}))
- Expect(cfg.Int).NotTo(Equal([]int{5, 4}))
- })
- It("should have the expected values for int-shorthand-slice", func() {
- Expect(len(cfg.IntP)).To(Equal(3))
- Expect(cfg.IntP).To(Equal([]int{1, 2, 3}))
- })
- It("should have the expected values for string-slice", func() {
- Expect(len(cfg.String)).To(Equal(3))
- Expect(cfg.String).To(Equal([]string{"a", "b", "c"}))
- })
- It("should have the expected values for string-shorthand-slice", func() {
- Expect(len(cfg.StringP)).To(Equal(2))
- Expect(cfg.StringP).To(Equal([]string{"hallo", "welt"}))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/sub-struct_test.go b/vendor/github.com/Luzifer/rconfig/sub-struct_test.go
deleted file mode 100644
index cfbfbc2..0000000
--- a/vendor/github.com/Luzifer/rconfig/sub-struct_test.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package rconfig
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing sub-structs", func() {
- type t struct {
- Test string `default:"blubb"`
- Sub struct {
- Test string `default:"Hallo"`
- }
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{}
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test).To(Equal("blubb"))
- Expect(cfg.Sub.Test).To(Equal("Hallo"))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/uint_test.go b/vendor/github.com/Luzifer/rconfig/uint_test.go
deleted file mode 100644
index 886db1d..0000000
--- a/vendor/github.com/Luzifer/rconfig/uint_test.go
+++ /dev/null
@@ -1,59 +0,0 @@
-package rconfig
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing uint parsing", func() {
- type t struct {
- Test uint `flag:"int"`
- TestP uint `flag:"intp,i"`
- Test8 uint8 `flag:"int8"`
- Test8P uint8 `flag:"int8p,8"`
- Test16 uint16 `flag:"int16"`
- Test16P uint16 `flag:"int16p,1"`
- Test32 uint32 `flag:"int32"`
- Test32P uint32 `flag:"int32p,3"`
- Test64 uint64 `flag:"int64"`
- Test64P uint64 `flag:"int64p,6"`
- TestDef uint8 `default:"66"`
- }
-
- var (
- err error
- args []string
- cfg t
- )
-
- BeforeEach(func() {
- cfg = t{}
- args = []string{
- "--int=1", "-i", "2",
- "--int8=3", "-8", "4",
- "--int32=5", "-3", "6",
- "--int64=7", "-6", "8",
- "--int16=9", "-1", "10",
- }
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.Test).To(Equal(uint(1)))
- Expect(cfg.TestP).To(Equal(uint(2)))
- Expect(cfg.Test8).To(Equal(uint8(3)))
- Expect(cfg.Test8P).To(Equal(uint8(4)))
- Expect(cfg.Test32).To(Equal(uint32(5)))
- Expect(cfg.Test32P).To(Equal(uint32(6)))
- Expect(cfg.Test64).To(Equal(uint64(7)))
- Expect(cfg.Test64P).To(Equal(uint64(8)))
- Expect(cfg.Test16).To(Equal(uint16(9)))
- Expect(cfg.Test16P).To(Equal(uint16(10)))
-
- Expect(cfg.TestDef).To(Equal(uint8(66)))
- })
-})
diff --git a/vendor/github.com/Luzifer/rconfig/vardefault_test.go b/vendor/github.com/Luzifer/rconfig/vardefault_test.go
deleted file mode 100644
index 8328919..0000000
--- a/vendor/github.com/Luzifer/rconfig/vardefault_test.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package rconfig
-
-import (
- "io/ioutil"
- "os"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing variable defaults", func() {
-
- type t struct {
- MySecretValue string `default:"secret" env:"foo" vardefault:"my_secret_value"`
- MyUsername string `default:"luzifer" vardefault:"username"`
- SomeVar string `flag:"var" description:"some variable"`
- IntVar int64 `vardefault:"int_var" default:"23"`
- }
-
- var (
- err error
- cfg t
- args = []string{}
- vardefaults = map[string]string{
- "my_secret_value": "veryverysecretkey",
- "unkownkey": "hi there",
- "int_var": "42",
- }
- )
-
- BeforeEach(func() {
- cfg = t{}
- })
-
- JustBeforeEach(func() {
- err = parse(&cfg, args)
- })
-
- Context("With manually provided variables", func() {
- BeforeEach(func() {
- SetVariableDefaults(vardefaults)
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.IntVar).To(Equal(int64(42)))
- Expect(cfg.MySecretValue).To(Equal("veryverysecretkey"))
- Expect(cfg.MyUsername).To(Equal("luzifer"))
- Expect(cfg.SomeVar).To(Equal(""))
- })
- })
-
- Context("With defaults from YAML data", func() {
- BeforeEach(func() {
- yamlData := []byte("---\nmy_secret_value: veryverysecretkey\nunknownkey: hi there\nint_var: 42\n")
- SetVariableDefaults(VarDefaultsFromYAML(yamlData))
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.IntVar).To(Equal(int64(42)))
- Expect(cfg.MySecretValue).To(Equal("veryverysecretkey"))
- Expect(cfg.MyUsername).To(Equal("luzifer"))
- Expect(cfg.SomeVar).To(Equal(""))
- })
- })
-
- Context("With defaults from YAML file", func() {
- var tmp *os.File
-
- BeforeEach(func() {
- tmp, _ = ioutil.TempFile("", "")
- yamlData := "---\nmy_secret_value: veryverysecretkey\nunknownkey: hi there\nint_var: 42\n"
- tmp.WriteString(yamlData)
- SetVariableDefaults(VarDefaultsFromYAMLFile(tmp.Name()))
- })
-
- AfterEach(func() {
- tmp.Close()
- os.Remove(tmp.Name())
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.IntVar).To(Equal(int64(42)))
- Expect(cfg.MySecretValue).To(Equal("veryverysecretkey"))
- Expect(cfg.MyUsername).To(Equal("luzifer"))
- Expect(cfg.SomeVar).To(Equal(""))
- })
- })
-
- Context("With defaults from invalid YAML data", func() {
- BeforeEach(func() {
- yamlData := []byte("---\nmy_secret_value = veryverysecretkey\nunknownkey = hi there\nint_var = 42\n")
- SetVariableDefaults(VarDefaultsFromYAML(yamlData))
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.IntVar).To(Equal(int64(23)))
- Expect(cfg.MySecretValue).To(Equal("secret"))
- Expect(cfg.MyUsername).To(Equal("luzifer"))
- Expect(cfg.SomeVar).To(Equal(""))
- })
- })
-
- Context("With defaults from non existent YAML file", func() {
- BeforeEach(func() {
- file := "/tmp/this_file_should_not_exist_146e26723r"
- SetVariableDefaults(VarDefaultsFromYAMLFile(file))
- })
-
- It("should not have errored", func() { Expect(err).NotTo(HaveOccurred()) })
- It("should have the expected values", func() {
- Expect(cfg.IntVar).To(Equal(int64(23)))
- Expect(cfg.MySecretValue).To(Equal("secret"))
- Expect(cfg.MyUsername).To(Equal("luzifer"))
- Expect(cfg.SomeVar).To(Equal(""))
- })
- })
-
-})
diff --git a/vendor/github.com/beorn7/perks/.gitignore b/vendor/github.com/beorn7/perks/.gitignore
deleted file mode 100644
index 1bd9209..0000000
--- a/vendor/github.com/beorn7/perks/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.test
-*.prof
diff --git a/vendor/github.com/beorn7/perks/README.md b/vendor/github.com/beorn7/perks/README.md
deleted file mode 100644
index fc05777..0000000
--- a/vendor/github.com/beorn7/perks/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Perks for Go (golang.org)
-
-Perks contains the Go package quantile that computes approximate quantiles over
-an unbounded data stream within low memory and CPU bounds.
-
-For more information and examples, see:
-http://godoc.org/github.com/bmizerany/perks
-
-A very special thank you and shout out to Graham Cormode (Rutgers University),
-Flip Korn (AT&T Labs–Research), S. Muthukrishnan (Rutgers University), and
-Divesh Srivastava (AT&T Labs–Research) for their research and publication of
-[Effective Computation of Biased Quantiles over Data Streams](http://www.cs.rutgers.edu/~muthu/bquant.pdf)
-
-Thank you, also:
-* Armon Dadgar (@armon)
-* Andrew Gerrand (@nf)
-* Brad Fitzpatrick (@bradfitz)
-* Keith Rarick (@kr)
-
-FAQ:
-
-Q: Why not move the quantile package into the project root?
-A: I want to add more packages to perks later.
-
-Copyright (C) 2013 Blake Mizerany
-
-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/github.com/beorn7/perks/histogram/bench_test.go b/vendor/github.com/beorn7/perks/histogram/bench_test.go
deleted file mode 100644
index 56c7e55..0000000
--- a/vendor/github.com/beorn7/perks/histogram/bench_test.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package histogram
-
-import (
- "math/rand"
- "testing"
-)
-
-func BenchmarkInsert10Bins(b *testing.B) {
- b.StopTimer()
- h := New(10)
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- f := rand.ExpFloat64()
- h.Insert(f)
- }
-}
-
-func BenchmarkInsert100Bins(b *testing.B) {
- b.StopTimer()
- h := New(100)
- b.StartTimer()
- for i := 0; i < b.N; i++ {
- f := rand.ExpFloat64()
- h.Insert(f)
- }
-}
diff --git a/vendor/github.com/beorn7/perks/histogram/histogram.go b/vendor/github.com/beorn7/perks/histogram/histogram.go
deleted file mode 100644
index bef05c7..0000000
--- a/vendor/github.com/beorn7/perks/histogram/histogram.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// Package histogram provides a Go implementation of BigML's histogram package
-// for Clojure/Java. It is currently experimental.
-package histogram
-
-import (
- "container/heap"
- "math"
- "sort"
-)
-
-type Bin struct {
- Count int
- Sum float64
-}
-
-func (b *Bin) Update(x *Bin) {
- b.Count += x.Count
- b.Sum += x.Sum
-}
-
-func (b *Bin) Mean() float64 {
- return b.Sum / float64(b.Count)
-}
-
-type Bins []*Bin
-
-func (bs Bins) Len() int { return len(bs) }
-func (bs Bins) Less(i, j int) bool { return bs[i].Mean() < bs[j].Mean() }
-func (bs Bins) Swap(i, j int) { bs[i], bs[j] = bs[j], bs[i] }
-
-func (bs *Bins) Push(x interface{}) {
- *bs = append(*bs, x.(*Bin))
-}
-
-func (bs *Bins) Pop() interface{} {
- return bs.remove(len(*bs) - 1)
-}
-
-func (bs *Bins) remove(n int) *Bin {
- if n < 0 || len(*bs) < n {
- return nil
- }
- x := (*bs)[n]
- *bs = append((*bs)[:n], (*bs)[n+1:]...)
- return x
-}
-
-type Histogram struct {
- res *reservoir
-}
-
-func New(maxBins int) *Histogram {
- return &Histogram{res: newReservoir(maxBins)}
-}
-
-func (h *Histogram) Insert(f float64) {
- h.res.insert(&Bin{1, f})
- h.res.compress()
-}
-
-func (h *Histogram) Bins() Bins {
- return h.res.bins
-}
-
-type reservoir struct {
- n int
- maxBins int
- bins Bins
-}
-
-func newReservoir(maxBins int) *reservoir {
- return &reservoir{maxBins: maxBins}
-}
-
-func (r *reservoir) insert(bin *Bin) {
- r.n += bin.Count
- i := sort.Search(len(r.bins), func(i int) bool {
- return r.bins[i].Mean() >= bin.Mean()
- })
- if i < 0 || i == r.bins.Len() {
- // TODO(blake): Maybe use an .insert(i, bin) instead of
- // performing the extra work of a heap.Push.
- heap.Push(&r.bins, bin)
- return
- }
- r.bins[i].Update(bin)
-}
-
-func (r *reservoir) compress() {
- for r.bins.Len() > r.maxBins {
- minGapIndex := -1
- minGap := math.MaxFloat64
- for i := 0; i < r.bins.Len()-1; i++ {
- gap := gapWeight(r.bins[i], r.bins[i+1])
- if minGap > gap {
- minGap = gap
- minGapIndex = i
- }
- }
- prev := r.bins[minGapIndex]
- next := r.bins.remove(minGapIndex + 1)
- prev.Update(next)
- }
-}
-
-func gapWeight(prev, next *Bin) float64 {
- return next.Mean() - prev.Mean()
-}
diff --git a/vendor/github.com/beorn7/perks/histogram/histogram_test.go b/vendor/github.com/beorn7/perks/histogram/histogram_test.go
deleted file mode 100644
index 0575ebe..0000000
--- a/vendor/github.com/beorn7/perks/histogram/histogram_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-package histogram
-
-import (
- "math/rand"
- "testing"
-)
-
-func TestHistogram(t *testing.T) {
- const numPoints = 1e6
- const maxBins = 3
-
- h := New(maxBins)
- for i := 0; i < numPoints; i++ {
- f := rand.ExpFloat64()
- h.Insert(f)
- }
-
- bins := h.Bins()
- if g := len(bins); g > maxBins {
- t.Fatalf("got %d bins, wanted <= %d", g, maxBins)
- }
-
- for _, b := range bins {
- t.Logf("%+v", b)
- }
-
- if g := count(h.Bins()); g != numPoints {
- t.Fatalf("binned %d points, wanted %d", g, numPoints)
- }
-}
-
-func count(bins Bins) int {
- binCounts := 0
- for _, b := range bins {
- binCounts += b.Count
- }
- return binCounts
-}
diff --git a/vendor/github.com/beorn7/perks/quantile/bench_test.go b/vendor/github.com/beorn7/perks/quantile/bench_test.go
deleted file mode 100644
index 0bd0e4e..0000000
--- a/vendor/github.com/beorn7/perks/quantile/bench_test.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package quantile
-
-import (
- "testing"
-)
-
-func BenchmarkInsertTargeted(b *testing.B) {
- b.ReportAllocs()
-
- s := NewTargeted(Targets)
- b.ResetTimer()
- for i := float64(0); i < float64(b.N); i++ {
- s.Insert(i)
- }
-}
-
-func BenchmarkInsertTargetedSmallEpsilon(b *testing.B) {
- s := NewTargeted(TargetsSmallEpsilon)
- b.ResetTimer()
- for i := float64(0); i < float64(b.N); i++ {
- s.Insert(i)
- }
-}
-
-func BenchmarkInsertBiased(b *testing.B) {
- s := NewLowBiased(0.01)
- b.ResetTimer()
- for i := float64(0); i < float64(b.N); i++ {
- s.Insert(i)
- }
-}
-
-func BenchmarkInsertBiasedSmallEpsilon(b *testing.B) {
- s := NewLowBiased(0.0001)
- b.ResetTimer()
- for i := float64(0); i < float64(b.N); i++ {
- s.Insert(i)
- }
-}
-
-func BenchmarkQuery(b *testing.B) {
- s := NewTargeted(Targets)
- for i := float64(0); i < 1e6; i++ {
- s.Insert(i)
- }
- b.ResetTimer()
- n := float64(b.N)
- for i := float64(0); i < n; i++ {
- s.Query(i / n)
- }
-}
-
-func BenchmarkQuerySmallEpsilon(b *testing.B) {
- s := NewTargeted(TargetsSmallEpsilon)
- for i := float64(0); i < 1e6; i++ {
- s.Insert(i)
- }
- b.ResetTimer()
- n := float64(b.N)
- for i := float64(0); i < n; i++ {
- s.Query(i / n)
- }
-}
diff --git a/vendor/github.com/beorn7/perks/quantile/example_test.go b/vendor/github.com/beorn7/perks/quantile/example_test.go
deleted file mode 100644
index ab3293a..0000000
--- a/vendor/github.com/beorn7/perks/quantile/example_test.go
+++ /dev/null
@@ -1,121 +0,0 @@
-// +build go1.1
-
-package quantile_test
-
-import (
- "bufio"
- "fmt"
- "log"
- "os"
- "strconv"
- "time"
-
- "github.com/beorn7/perks/quantile"
-)
-
-func Example_simple() {
- ch := make(chan float64)
- go sendFloats(ch)
-
- // Compute the 50th, 90th, and 99th percentile.
- q := quantile.NewTargeted(map[float64]float64{
- 0.50: 0.005,
- 0.90: 0.001,
- 0.99: 0.0001,
- })
- for v := range ch {
- q.Insert(v)
- }
-
- fmt.Println("perc50:", q.Query(0.50))
- fmt.Println("perc90:", q.Query(0.90))
- fmt.Println("perc99:", q.Query(0.99))
- fmt.Println("count:", q.Count())
- // Output:
- // perc50: 5
- // perc90: 16
- // perc99: 223
- // count: 2388
-}
-
-func Example_mergeMultipleStreams() {
- // Scenario:
- // We have multiple database shards. On each shard, there is a process
- // collecting query response times from the database logs and inserting
- // them into a Stream (created via NewTargeted(0.90)), much like the
- // Simple example. These processes expose a network interface for us to
- // ask them to serialize and send us the results of their
- // Stream.Samples so we may Merge and Query them.
- //
- // NOTES:
- // * These sample sets are small, allowing us to get them
- // across the network much faster than sending the entire list of data
- // points.
- //
- // * For this to work correctly, we must supply the same quantiles
- // a priori the process collecting the samples supplied to NewTargeted,
- // even if we do not plan to query them all here.
- ch := make(chan quantile.Samples)
- getDBQuerySamples(ch)
- q := quantile.NewTargeted(map[float64]float64{0.90: 0.001})
- for samples := range ch {
- q.Merge(samples)
- }
- fmt.Println("perc90:", q.Query(0.90))
-}
-
-func Example_window() {
- // Scenario: We want the 90th, 95th, and 99th percentiles for each
- // minute.
-
- ch := make(chan float64)
- go sendStreamValues(ch)
-
- tick := time.NewTicker(1 * time.Minute)
- q := quantile.NewTargeted(map[float64]float64{
- 0.90: 0.001,
- 0.95: 0.0005,
- 0.99: 0.0001,
- })
- for {
- select {
- case t := <-tick.C:
- flushToDB(t, q.Samples())
- q.Reset()
- case v := <-ch:
- q.Insert(v)
- }
- }
-}
-
-func sendStreamValues(ch chan float64) {
- // Use your imagination
-}
-
-func flushToDB(t time.Time, samples quantile.Samples) {
- // Use your imagination
-}
-
-// This is a stub for the above example. In reality this would hit the remote
-// servers via http or something like it.
-func getDBQuerySamples(ch chan quantile.Samples) {}
-
-func sendFloats(ch chan<- float64) {
- f, err := os.Open("exampledata.txt")
- if err != nil {
- log.Fatal(err)
- }
- sc := bufio.NewScanner(f)
- for sc.Scan() {
- b := sc.Bytes()
- v, err := strconv.ParseFloat(string(b), 64)
- if err != nil {
- log.Fatal(err)
- }
- ch <- v
- }
- if sc.Err() != nil {
- log.Fatal(sc.Err())
- }
- close(ch)
-}
diff --git a/vendor/github.com/beorn7/perks/quantile/stream.go b/vendor/github.com/beorn7/perks/quantile/stream.go
index f4cabd6..d7d14f8 100644
--- a/vendor/github.com/beorn7/perks/quantile/stream.go
+++ b/vendor/github.com/beorn7/perks/quantile/stream.go
@@ -77,15 +77,20 @@ func NewHighBiased(epsilon float64) *Stream {
// is guaranteed to be within (Quantile±Epsilon).
//
// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.
-func NewTargeted(targets map[float64]float64) *Stream {
+func NewTargeted(targetMap map[float64]float64) *Stream {
+ // Convert map to slice to avoid slow iterations on a map.
+ // ƒ is called on the hot path, so converting the map to a slice
+ // beforehand results in significant CPU savings.
+ targets := targetMapToSlice(targetMap)
+
ƒ := func(s *stream, r float64) float64 {
var m = math.MaxFloat64
var f float64
- for quantile, epsilon := range targets {
- if quantile*s.n <= r {
- f = (2 * epsilon * r) / quantile
+ for _, t := range targets {
+ if t.quantile*s.n <= r {
+ f = (2 * t.epsilon * r) / t.quantile
} else {
- f = (2 * epsilon * (s.n - r)) / (1 - quantile)
+ f = (2 * t.epsilon * (s.n - r)) / (1 - t.quantile)
}
if f < m {
m = f
@@ -96,6 +101,25 @@ func NewTargeted(targets map[float64]float64) *Stream {
return newStream(ƒ)
}
+type target struct {
+ quantile float64
+ epsilon float64
+}
+
+func targetMapToSlice(targetMap map[float64]float64) []target {
+ targets := make([]target, 0, len(targetMap))
+
+ for quantile, epsilon := range targetMap {
+ t := target{
+ quantile: quantile,
+ epsilon: epsilon,
+ }
+ targets = append(targets, t)
+ }
+
+ return targets
+}
+
// Stream computes quantiles for a stream of float64s. It is not thread-safe by
// design. Take care when using across multiple goroutines.
type Stream struct {
diff --git a/vendor/github.com/beorn7/perks/quantile/stream_test.go b/vendor/github.com/beorn7/perks/quantile/stream_test.go
deleted file mode 100644
index 8551950..0000000
--- a/vendor/github.com/beorn7/perks/quantile/stream_test.go
+++ /dev/null
@@ -1,215 +0,0 @@
-package quantile
-
-import (
- "math"
- "math/rand"
- "sort"
- "testing"
-)
-
-var (
- Targets = map[float64]float64{
- 0.01: 0.001,
- 0.10: 0.01,
- 0.50: 0.05,
- 0.90: 0.01,
- 0.99: 0.001,
- }
- TargetsSmallEpsilon = map[float64]float64{
- 0.01: 0.0001,
- 0.10: 0.001,
- 0.50: 0.005,
- 0.90: 0.001,
- 0.99: 0.0001,
- }
- LowQuantiles = []float64{0.01, 0.1, 0.5}
- HighQuantiles = []float64{0.99, 0.9, 0.5}
-)
-
-const RelativeEpsilon = 0.01
-
-func verifyPercsWithAbsoluteEpsilon(t *testing.T, a []float64, s *Stream) {
- sort.Float64s(a)
- for quantile, epsilon := range Targets {
- n := float64(len(a))
- k := int(quantile * n)
- if k < 1 {
- k = 1
- }
- lower := int((quantile - epsilon) * n)
- if lower < 1 {
- lower = 1
- }
- upper := int(math.Ceil((quantile + epsilon) * n))
- if upper > len(a) {
- upper = len(a)
- }
- w, min, max := a[k-1], a[lower-1], a[upper-1]
- if g := s.Query(quantile); g < min || g > max {
- t.Errorf("q=%f: want %v [%f,%f], got %v", quantile, w, min, max, g)
- }
- }
-}
-
-func verifyLowPercsWithRelativeEpsilon(t *testing.T, a []float64, s *Stream) {
- sort.Float64s(a)
- for _, qu := range LowQuantiles {
- n := float64(len(a))
- k := int(qu * n)
-
- lowerRank := int((1 - RelativeEpsilon) * qu * n)
- upperRank := int(math.Ceil((1 + RelativeEpsilon) * qu * n))
- w, min, max := a[k-1], a[lowerRank-1], a[upperRank-1]
- if g := s.Query(qu); g < min || g > max {
- t.Errorf("q=%f: want %v [%f,%f], got %v", qu, w, min, max, g)
- }
- }
-}
-
-func verifyHighPercsWithRelativeEpsilon(t *testing.T, a []float64, s *Stream) {
- sort.Float64s(a)
- for _, qu := range HighQuantiles {
- n := float64(len(a))
- k := int(qu * n)
-
- lowerRank := int((1 - (1+RelativeEpsilon)*(1-qu)) * n)
- upperRank := int(math.Ceil((1 - (1-RelativeEpsilon)*(1-qu)) * n))
- w, min, max := a[k-1], a[lowerRank-1], a[upperRank-1]
- if g := s.Query(qu); g < min || g > max {
- t.Errorf("q=%f: want %v [%f,%f], got %v", qu, w, min, max, g)
- }
- }
-}
-
-func populateStream(s *Stream) []float64 {
- a := make([]float64, 0, 1e5+100)
- for i := 0; i < cap(a); i++ {
- v := rand.NormFloat64()
- // Add 5% asymmetric outliers.
- if i%20 == 0 {
- v = v*v + 1
- }
- s.Insert(v)
- a = append(a, v)
- }
- return a
-}
-
-func TestTargetedQuery(t *testing.T) {
- rand.Seed(42)
- s := NewTargeted(Targets)
- a := populateStream(s)
- verifyPercsWithAbsoluteEpsilon(t, a, s)
-}
-
-func TestTargetedQuerySmallSampleSize(t *testing.T) {
- rand.Seed(42)
- s := NewTargeted(TargetsSmallEpsilon)
- a := []float64{1, 2, 3, 4, 5}
- for _, v := range a {
- s.Insert(v)
- }
- verifyPercsWithAbsoluteEpsilon(t, a, s)
- // If not yet flushed, results should be precise:
- if !s.flushed() {
- for φ, want := range map[float64]float64{
- 0.01: 1,
- 0.10: 1,
- 0.50: 3,
- 0.90: 5,
- 0.99: 5,
- } {
- if got := s.Query(φ); got != want {
- t.Errorf("want %f for φ=%f, got %f", want, φ, got)
- }
- }
- }
-}
-
-func TestLowBiasedQuery(t *testing.T) {
- rand.Seed(42)
- s := NewLowBiased(RelativeEpsilon)
- a := populateStream(s)
- verifyLowPercsWithRelativeEpsilon(t, a, s)
-}
-
-func TestHighBiasedQuery(t *testing.T) {
- rand.Seed(42)
- s := NewHighBiased(RelativeEpsilon)
- a := populateStream(s)
- verifyHighPercsWithRelativeEpsilon(t, a, s)
-}
-
-// BrokenTestTargetedMerge is broken, see Merge doc comment.
-func BrokenTestTargetedMerge(t *testing.T) {
- rand.Seed(42)
- s1 := NewTargeted(Targets)
- s2 := NewTargeted(Targets)
- a := populateStream(s1)
- a = append(a, populateStream(s2)...)
- s1.Merge(s2.Samples())
- verifyPercsWithAbsoluteEpsilon(t, a, s1)
-}
-
-// BrokenTestLowBiasedMerge is broken, see Merge doc comment.
-func BrokenTestLowBiasedMerge(t *testing.T) {
- rand.Seed(42)
- s1 := NewLowBiased(RelativeEpsilon)
- s2 := NewLowBiased(RelativeEpsilon)
- a := populateStream(s1)
- a = append(a, populateStream(s2)...)
- s1.Merge(s2.Samples())
- verifyLowPercsWithRelativeEpsilon(t, a, s2)
-}
-
-// BrokenTestHighBiasedMerge is broken, see Merge doc comment.
-func BrokenTestHighBiasedMerge(t *testing.T) {
- rand.Seed(42)
- s1 := NewHighBiased(RelativeEpsilon)
- s2 := NewHighBiased(RelativeEpsilon)
- a := populateStream(s1)
- a = append(a, populateStream(s2)...)
- s1.Merge(s2.Samples())
- verifyHighPercsWithRelativeEpsilon(t, a, s2)
-}
-
-func TestUncompressed(t *testing.T) {
- q := NewTargeted(Targets)
- for i := 100; i > 0; i-- {
- q.Insert(float64(i))
- }
- if g := q.Count(); g != 100 {
- t.Errorf("want count 100, got %d", g)
- }
- // Before compression, Query should have 100% accuracy.
- for quantile := range Targets {
- w := quantile * 100
- if g := q.Query(quantile); g != w {
- t.Errorf("want %f, got %f", w, g)
- }
- }
-}
-
-func TestUncompressedSamples(t *testing.T) {
- q := NewTargeted(map[float64]float64{0.99: 0.001})
- for i := 1; i <= 100; i++ {
- q.Insert(float64(i))
- }
- if g := q.Samples().Len(); g != 100 {
- t.Errorf("want count 100, got %d", g)
- }
-}
-
-func TestUncompressedOne(t *testing.T) {
- q := NewTargeted(map[float64]float64{0.99: 0.01})
- q.Insert(3.14)
- if g := q.Query(0.90); g != 3.14 {
- t.Error("want PI, got", g)
- }
-}
-
-func TestDefaults(t *testing.T) {
- if g := NewTargeted(map[float64]float64{0.99: 0.001}).Query(0.99); g != 0 {
- t.Errorf("want 0, got %f", g)
- }
-}
diff --git a/vendor/github.com/beorn7/perks/topk/topk.go b/vendor/github.com/beorn7/perks/topk/topk.go
deleted file mode 100644
index 5ac3d99..0000000
--- a/vendor/github.com/beorn7/perks/topk/topk.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package topk
-
-import (
- "sort"
-)
-
-// http://www.cs.ucsb.edu/research/tech_reports/reports/2005-23.pdf
-
-type Element struct {
- Value string
- Count int
-}
-
-type Samples []*Element
-
-func (sm Samples) Len() int {
- return len(sm)
-}
-
-func (sm Samples) Less(i, j int) bool {
- return sm[i].Count < sm[j].Count
-}
-
-func (sm Samples) Swap(i, j int) {
- sm[i], sm[j] = sm[j], sm[i]
-}
-
-type Stream struct {
- k int
- mon map[string]*Element
-
- // the minimum Element
- min *Element
-}
-
-func New(k int) *Stream {
- s := new(Stream)
- s.k = k
- s.mon = make(map[string]*Element)
- s.min = &Element{}
-
- // Track k+1 so that less frequenet items contended for that spot,
- // resulting in k being more accurate.
- return s
-}
-
-func (s *Stream) Insert(x string) {
- s.insert(&Element{x, 1})
-}
-
-func (s *Stream) Merge(sm Samples) {
- for _, e := range sm {
- s.insert(e)
- }
-}
-
-func (s *Stream) insert(in *Element) {
- e := s.mon[in.Value]
- if e != nil {
- e.Count++
- } else {
- if len(s.mon) < s.k+1 {
- e = &Element{in.Value, in.Count}
- s.mon[in.Value] = e
- } else {
- e = s.min
- delete(s.mon, e.Value)
- e.Value = in.Value
- e.Count += in.Count
- s.min = e
- }
- }
- if e.Count < s.min.Count {
- s.min = e
- }
-}
-
-func (s *Stream) Query() Samples {
- var sm Samples
- for _, e := range s.mon {
- sm = append(sm, e)
- }
- sort.Sort(sort.Reverse(sm))
-
- if len(sm) < s.k {
- return sm
- }
-
- return sm[:s.k]
-}
diff --git a/vendor/github.com/beorn7/perks/topk/topk_test.go b/vendor/github.com/beorn7/perks/topk/topk_test.go
deleted file mode 100644
index c24f0f7..0000000
--- a/vendor/github.com/beorn7/perks/topk/topk_test.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package topk
-
-import (
- "fmt"
- "math/rand"
- "sort"
- "testing"
-)
-
-func TestTopK(t *testing.T) {
- stream := New(10)
- ss := []*Stream{New(10), New(10), New(10)}
- m := make(map[string]int)
- for _, s := range ss {
- for i := 0; i < 1e6; i++ {
- v := fmt.Sprintf("%x", int8(rand.ExpFloat64()))
- s.Insert(v)
- m[v]++
- }
- stream.Merge(s.Query())
- }
-
- var sm Samples
- for x, s := range m {
- sm = append(sm, &Element{x, s})
- }
- sort.Sort(sort.Reverse(sm))
-
- g := stream.Query()
- if len(g) != 10 {
- t.Fatalf("got %d, want 10", len(g))
- }
- for i, e := range g {
- if sm[i].Value != e.Value {
- t.Errorf("at %d: want %q, got %q", i, sm[i].Value, e.Value)
- }
- }
-}
-
-func TestQuery(t *testing.T) {
- queryTests := []struct {
- value string
- expected int
- }{
- {"a", 1},
- {"b", 2},
- {"c", 2},
- }
-
- stream := New(2)
- for _, tt := range queryTests {
- stream.Insert(tt.value)
- if n := len(stream.Query()); n != tt.expected {
- t.Errorf("want %d, got %d", tt.expected, n)
- }
- }
-}
diff --git a/vendor/github.com/flosch/pongo2/.gitignore b/vendor/github.com/flosch/pongo2/.gitignore
index 1346be5..37eaf44 100644
--- a/vendor/github.com/flosch/pongo2/.gitignore
+++ b/vendor/github.com/flosch/pongo2/.gitignore
@@ -7,7 +7,6 @@
_obj
_test
.idea
-.vscode
# Architecture specific extensions/prefixes
*.[568vq]
diff --git a/vendor/github.com/flosch/pongo2/.travis.yml b/vendor/github.com/flosch/pongo2/.travis.yml
index 0445a45..a22ad21 100644
--- a/vendor/github.com/flosch/pongo2/.travis.yml
+++ b/vendor/github.com/flosch/pongo2/.travis.yml
@@ -1,13 +1,12 @@
language: go
go:
- - 1.7
+ - 1.3
- tip
install:
- - go get golang.org/x/tools/cmd/cover
+ - go get code.google.com/p/go.tools/cmd/cover
- go get github.com/mattn/goveralls
- go get gopkg.in/check.v1
- - go get github.com/juju/errors
script:
- go test -v -covermode=count -coverprofile=coverage.out -bench . -cpu 1,4
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN || true'
diff --git a/vendor/github.com/flosch/pongo2/README.md b/vendor/github.com/flosch/pongo2/README.md
index 33def30..7c61e9e 100644
--- a/vendor/github.com/flosch/pongo2/README.md
+++ b/vendor/github.com/flosch/pongo2/README.md
@@ -1,9 +1,8 @@
# [pongo](https://en.wikipedia.org/wiki/Pongo_%28genus%29)2
-[![Join the chat at https://gitter.im/flosch/pongo2](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/flosch/pongo2)
-[![GoDoc](https://godoc.org/github.com/flosch/pongo2?status.svg)](https://godoc.org/github.com/flosch/pongo2)
+[![GoDoc](https://godoc.org/github.com/flosch/pongo2?status.png)](https://godoc.org/github.com/flosch/pongo2)
[![Build Status](https://travis-ci.org/flosch/pongo2.svg?branch=master)](https://travis-ci.org/flosch/pongo2)
-[![Coverage Status](https://coveralls.io/repos/flosch/pongo2/badge.svg?branch=master)](https://coveralls.io/r/flosch/pongo2?branch=master)
+[![Coverage Status](https://coveralls.io/repos/flosch/pongo2/badge.png?branch=master)](https://coveralls.io/r/flosch/pongo2?branch=master)
[![gratipay](http://img.shields.io/badge/gratipay-support%20pongo-brightgreen.svg)](https://gratipay.com/flosch/)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=3654947)](https://www.bountysource.com/trackers/3654947-pongo2?utm_source=3654947&utm_medium=shield&utm_campaign=TRACKER_BADGE)
@@ -96,7 +95,6 @@ Please also have a look on the [caveats](https://github.com/flosch/pongo2#caveat
If you're using the `master`-branch of pongo2, you might be interested in this section. Since pongo2 is still in development (even though there is a first stable release!), there could be (backwards-incompatible) API changes over time. To keep track of these and therefore make it painless for you to adapt your codebase, I'll list them here.
- * Function signature for tag execution changed: not taking a `bytes.Buffer` anymore; instead `Execute()`-functions are now taking a `TemplateWriter` interface.
* Function signature for tag and filter parsing/execution changed (`error` return type changed to `*Error`).
* `INodeEvaluator` has been removed and got replaced by `IEvaluator`. You can change your existing tags/filters by simply replacing the interface.
* Two new helper functions: [`RenderTemplateFile()`](https://godoc.org/github.com/flosch/pongo2#RenderTemplateFile) and [`RenderTemplateString()`](https://godoc.org/github.com/flosch/pongo2#RenderTemplateString).
@@ -106,7 +104,7 @@ If you're using the `master`-branch of pongo2, you might be interested in this s
## How you can help
* Write [filters](https://github.com/flosch/pongo2/blob/master/filters_builtin.go#L3) / [tags](https://github.com/flosch/pongo2/blob/master/tags.go#L4) (see [tutorial](https://www.florian-schlachter.de/post/pongo2/)) by forking pongo2 and sending pull requests
- * Write/improve code tests (use the following command to see what tests are missing: `go test -v -cover -covermode=count -coverprofile=cover.out && go tool cover -html=cover.out` or have a look on [gocover.io/github.com/flosch/pongo2](http://gocover.io/github.com/flosch/pongo2))
+ * Write/improve code tests (use the following command to see what tests are missing: `go test -v -cover -covermode=count -coverprofile=cover.out && go tool cover -html=cover.out`)
* Write/improve template tests (see the `template_tests/` directory)
* Write middleware, libraries and websites using pongo2. :-)
@@ -117,8 +115,7 @@ For a documentation on how the templating language works you can [head over to t
You can access pongo2's API documentation on [godoc](https://godoc.org/github.com/flosch/pongo2).
## Blog post series
-
- * [pongo2 v3 released](https://www.florian-schlachter.de/post/pongo2-v3/)
+
* [pongo2 v2 released](https://www.florian-schlachter.de/post/pongo2-v2/)
* [pongo2 1.0 released](https://www.florian-schlachter.de/post/pongo2-10/) [August 8th 2014]
* [pongo2 playground](https://www.florian-schlachter.de/post/pongo2-playground/) [August 1st 2014]
@@ -157,12 +154,8 @@ You can access pongo2's API documentation on [godoc](https://godoc.org/github.co
* [beego-pongo2.v2](https://github.com/ipfans/beego-pongo2.v2) - Same as `beego-pongo2`, but for pongo2 v2.
* [macaron-pongo2](https://github.com/macaron-contrib/pongo2) - pongo2 support for [Macaron](https://github.com/Unknwon/macaron), a modular web framework.
* [ginpongo2](https://github.com/ngerakines/ginpongo2) - middleware for [gin](github.com/gin-gonic/gin) to use pongo2 templates
- * [Build'n support for Iris' template engine](https://github.com/kataras/iris)
- * [pongo2gin](https://github.com/robvdl/pongo2gin) - alternative renderer for [gin](github.com/gin-gonic/gin) to use pongo2 templates
- * [pongo2-trans](https://github.com/digitalcrab/pongo2trans) - `trans`-tag implementation for internationalization
- * [tpongo2](https://github.com/tango-contrib/tpongo2) - pongo2 support for [Tango](https://github.com/lunny/tango), a micro-kernel & pluggable web framework.
- * [p2cli](https://github.com/wrouesnel/p2cli) - command line templating utility based on pongo2
-
+ * [pongo2-trans](https://github.com/fromYukki/pongo2trans) - `trans`-tag implementation for internationalization
+
Please add your project to this list and send me a pull request when you've developed something nice for pongo2.
# API-usage examples
diff --git a/vendor/github.com/flosch/pongo2/context.go b/vendor/github.com/flosch/pongo2/context.go
index 6e3c166..df587c8 100644
--- a/vendor/github.com/flosch/pongo2/context.go
+++ b/vendor/github.com/flosch/pongo2/context.go
@@ -1,14 +1,13 @@
package pongo2
import (
+ "fmt"
"regexp"
-
- "github.com/juju/errors"
)
var reIdentifiers = regexp.MustCompile("^[a-zA-Z0-9_]+$")
-// A Context type provides constants, variables, instances or functions to a template.
+// Use this Context type to provide constants, variables, instances or functions to your template.
//
// pongo2 automatically provides meta-information or functions through the "pongo2"-key.
// Currently, context["pongo2"] contains the following keys:
@@ -25,15 +24,14 @@ func (c Context) checkForValidIdentifiers() *Error {
for k, v := range c {
if !reIdentifiers.MatchString(k) {
return &Error{
- Sender: "checkForValidIdentifiers",
- OrigError: errors.Errorf("context-key '%s' (value: '%+v') is not a valid identifier", k, v),
+ Sender: "checkForValidIdentifiers",
+ ErrorMsg: fmt.Sprintf("Context-key '%s' (value: '%+v') is not a valid identifier.", k, v),
}
}
}
return nil
}
-// Update updates this context with the key/value-pairs from another context.
func (c Context) Update(other Context) Context {
for k, v := range other {
c[k] = v
@@ -41,8 +39,6 @@ func (c Context) Update(other Context) Context {
return c
}
-// ExecutionContext contains all data important for the current rendering state.
-//
// If you're writing a custom tag, your tag's Execute()-function will
// have access to the ExecutionContext. This struct stores anything
// about the current rendering process's Context including
@@ -101,10 +97,6 @@ func NewChildExecutionContext(parent *ExecutionContext) *ExecutionContext {
}
func (ctx *ExecutionContext) Error(msg string, token *Token) *Error {
- return ctx.OrigError(errors.New(msg), token)
-}
-
-func (ctx *ExecutionContext) OrigError(err error, token *Token) *Error {
filename := ctx.template.name
var line, col int
if token != nil {
@@ -115,13 +107,13 @@ func (ctx *ExecutionContext) OrigError(err error, token *Token) *Error {
col = token.Col
}
return &Error{
- Template: ctx.template,
- Filename: filename,
- Line: line,
- Column: col,
- Token: token,
- Sender: "execution",
- OrigError: err,
+ Template: ctx.template,
+ Filename: filename,
+ Line: line,
+ Column: col,
+ Token: token,
+ Sender: "execution",
+ ErrorMsg: msg,
}
}
diff --git a/vendor/github.com/flosch/pongo2/docs/examples.md b/vendor/github.com/flosch/pongo2/docs/examples.md
deleted file mode 100644
index a98bb3a..0000000
--- a/vendor/github.com/flosch/pongo2/docs/examples.md
+++ /dev/null
@@ -1 +0,0 @@
-(Stub, TBA)
\ No newline at end of file
diff --git a/vendor/github.com/flosch/pongo2/docs/filters.md b/vendor/github.com/flosch/pongo2/docs/filters.md
deleted file mode 100644
index 40a3253..0000000
--- a/vendor/github.com/flosch/pongo2/docs/filters.md
+++ /dev/null
@@ -1,68 +0,0 @@
-TODO:
-
-* What are filters?
-* List+explain all existing filters (pongo2 + pongo2-addons)
-
-Implemented filters so far which needs documentation:
-
-* escape
-* safe
-* escapejs
-* add
-* addslashes
-* capfirst
-* center
-* cut
-* date
-* default
-* default_if_none
-* divisibleby
-* first
-* floatformat
-* get_digit
-* iriencode
-* join
-* last
-* length
-* length_is
-* linebreaks
-* linebreaksbr
-* linenumbers
-* ljust
-* lower
-* make_list
-* phone2numeric
-* pluralize
-* random
-* removetags
-* rjust
-* slice
-* stringformat
-* striptags
-* time
-* title
-* truncatechars
-* truncatechars_html
-* truncatewords
-* truncatewords_html
-* upper
-* urlencode
-* urlize
-* urlizetrunc
-* wordcount
-* wordwrap
-* yesno
-
-* filesizeformat*
-* slugify*
-* truncatesentences*
-* truncatesentences_html*
-* markdown*
-* intcomma*
-* ordinal*
-* naturalday*
-* timesince*
-* timeuntil*
-* naturaltime*
-
-Filters marked with * are available through [pongo2-addons](https://github.com/flosch/pongo2-addons).
\ No newline at end of file
diff --git a/vendor/github.com/flosch/pongo2/docs/index.md b/vendor/github.com/flosch/pongo2/docs/index.md
deleted file mode 100644
index a98bb3a..0000000
--- a/vendor/github.com/flosch/pongo2/docs/index.md
+++ /dev/null
@@ -1 +0,0 @@
-(Stub, TBA)
\ No newline at end of file
diff --git a/vendor/github.com/flosch/pongo2/docs/macros.md b/vendor/github.com/flosch/pongo2/docs/macros.md
deleted file mode 100644
index 2b27069..0000000
--- a/vendor/github.com/flosch/pongo2/docs/macros.md
+++ /dev/null
@@ -1 +0,0 @@
-(Stub, TBA)
diff --git a/vendor/github.com/flosch/pongo2/docs/tags.md b/vendor/github.com/flosch/pongo2/docs/tags.md
deleted file mode 100644
index dae4566..0000000
--- a/vendor/github.com/flosch/pongo2/docs/tags.md
+++ /dev/null
@@ -1,31 +0,0 @@
-TODO:
-
-* What are tags?
-* List+explain all existing tags (pongo2 + pongo2-addons)
-
-Implemented tags so far which needs documentation:
-
-* autoescape
-* block
-* comment
-* cycle
-* extends
-* filter
-* firstof
-* for
-* if
-* ifchanged
-* ifequal
-* ifnotequal
-* import
-* include
-* lorem
-* macro
-* now
-* set
-* spaceless
-* ssi
-* templatetag
-* verbatim
-* widthratio
-* with
\ No newline at end of file
diff --git a/vendor/github.com/flosch/pongo2/docs/template_sets.md b/vendor/github.com/flosch/pongo2/docs/template_sets.md
deleted file mode 100644
index a98bb3a..0000000
--- a/vendor/github.com/flosch/pongo2/docs/template_sets.md
+++ /dev/null
@@ -1 +0,0 @@
-(Stub, TBA)
\ No newline at end of file
diff --git a/vendor/github.com/flosch/pongo2/docs/write_filters.md b/vendor/github.com/flosch/pongo2/docs/write_filters.md
deleted file mode 100644
index e69de29..0000000
diff --git a/vendor/github.com/flosch/pongo2/docs/write_tags.md b/vendor/github.com/flosch/pongo2/docs/write_tags.md
deleted file mode 100644
index e69de29..0000000
diff --git a/vendor/github.com/flosch/pongo2/error.go b/vendor/github.com/flosch/pongo2/error.go
index 8aec8c1..c1ee86e 100644
--- a/vendor/github.com/flosch/pongo2/error.go
+++ b/vendor/github.com/flosch/pongo2/error.go
@@ -6,20 +6,20 @@ import (
"os"
)
-// The Error type is being used to address an error during lexing, parsing or
+// This Error type is being used to address an error during lexing, parsing or
// execution. If you want to return an error object (for example in your own
// tag or filter) fill this object with as much information as you have.
// Make sure "Sender" is always given (if you're returning an error within
// a filter, make Sender equals 'filter:yourfilter'; same goes for tags: 'tag:mytag').
// It's okay if you only fill in ErrorMsg if you don't have any other details at hand.
type Error struct {
- Template *Template
- Filename string
- Line int
- Column int
- Token *Token
- Sender string
- OrigError error
+ Template *Template
+ Filename string
+ Line int
+ Column int
+ Token *Token
+ Sender string
+ ErrorMsg string
}
func (e *Error) updateFromTokenIfNeeded(template *Template, t *Token) *Error {
@@ -54,14 +54,14 @@ func (e *Error) Error() string {
}
}
s += "] "
- s += e.OrigError.Error()
+ s += e.ErrorMsg
return s
}
-// RawLine returns the affected line from the original template, if available.
-func (e *Error) RawLine() (line string, available bool, outErr error) {
+// Returns the affected line from the original template, if available.
+func (e *Error) RawLine() (line string, available bool) {
if e.Line <= 0 || e.Filename == " Welcome to my new blog page. I'm using pongo2 which supports {{ variables }} and {% tags %}. ")
+ buffer.WriteString(" ")
par := tagLoremParagraphs[rand.Intn(len(tagLoremParagraphs))]
- writer.WriteString(par)
- writer.WriteString("
", -1)), nil
}
@@ -649,8 +641,7 @@ func filterUrlencode(in *Value, param *Value) (*Value, *Error) {
var filterUrlizeURLRegexp = regexp.MustCompile(`((((http|https)://)|www\.|((^|[ ])[0-9A-Za-z_\-]+(\.com|\.net|\.org|\.info|\.biz|\.de))))(?U:.*)([ ]+|$)`)
var filterUrlizeEmailRegexp = regexp.MustCompile(`(\w+@\w+\.\w{2,4})`)
-func filterUrlizeHelper(input string, autoescape bool, trunc int) (string, error) {
- var soutErr error
+func filterUrlizeHelper(input string, autoescape bool, trunc int) string {
sout := filterUrlizeURLRegexp.ReplaceAllStringFunc(input, func(raw_url string) string {
var prefix string
var suffix string
@@ -665,8 +656,7 @@ func filterUrlizeHelper(input string, autoescape bool, trunc int) (string, error
t, err := ApplyFilter("iriencode", AsValue(raw_url), nil)
if err != nil {
- soutErr = err
- return ""
+ panic(err)
}
url := t.String()
@@ -683,19 +673,16 @@ func filterUrlizeHelper(input string, autoescape bool, trunc int) (string, error
if autoescape {
t, err := ApplyFilter("escape", AsValue(title), nil)
if err != nil {
- soutErr = err
- return ""
+ panic(err)
}
title = t.String()
}
return fmt.Sprintf(`%s%s%s`, prefix, url, title, suffix)
})
- if soutErr != nil {
- return "", soutErr
- }
sout = filterUrlizeEmailRegexp.ReplaceAllStringFunc(sout, func(mail string) string {
+
title := mail
if trunc > 3 && len(title) > trunc {
@@ -705,7 +692,7 @@ func filterUrlizeHelper(input string, autoescape bool, trunc int) (string, error
return fmt.Sprintf(`%s`, mail, title)
})
- return sout, nil
+ return sout
}
func filterUrlize(in *Value, param *Value) (*Value, *Error) {
@@ -714,36 +701,24 @@ func filterUrlize(in *Value, param *Value) (*Value, *Error) {
autoescape = param.Bool()
}
- s, err := filterUrlizeHelper(in.String(), autoescape, -1)
- if err != nil {
-
- }
-
- return AsValue(s), nil
+ return AsValue(filterUrlizeHelper(in.String(), autoescape, -1)), nil
}
func filterUrlizetrunc(in *Value, param *Value) (*Value, *Error) {
- s, err := filterUrlizeHelper(in.String(), true, param.Integer())
- if err != nil {
- return nil, &Error{
- Sender: "filter:urlizetrunc",
- OrigError: errors.New("you cannot pass more than 2 arguments to filter 'pluralize'"),
- }
- }
- return AsValue(s), nil
+ return AsValue(filterUrlizeHelper(in.String(), true, param.Integer())), nil
}
func filterStringformat(in *Value, param *Value) (*Value, *Error) {
return AsValue(fmt.Sprintf(param.String(), in.Interface())), nil
}
-var reStriptags = regexp.MustCompile("<[^>]*?>")
+var re_striptags = regexp.MustCompile("<[^>]*?>")
func filterStriptags(in *Value, param *Value) (*Value, *Error) {
s := in.String()
// Strip all tags
- s = reStriptags.ReplaceAllString(s, "")
+ s = re_striptags.ReplaceAllString(s, "")
return AsValue(strings.TrimSpace(s)), nil
}
@@ -771,8 +746,8 @@ func filterPluralize(in *Value, param *Value) (*Value, *Error) {
endings := strings.Split(param.String(), ",")
if len(endings) > 2 {
return nil, &Error{
- Sender: "filter:pluralize",
- OrigError: errors.New("you cannot pass more than 2 arguments to filter 'pluralize'"),
+ Sender: "filter:pluralize",
+ ErrorMsg: "You cannot pass more than 2 arguments to filter 'pluralize'.",
}
}
if len(endings) == 1 {
@@ -795,10 +770,11 @@ func filterPluralize(in *Value, param *Value) (*Value, *Error) {
}
return AsValue(""), nil
- }
- return nil, &Error{
- Sender: "filter:pluralize",
- OrigError: errors.New("filter 'pluralize' does only work on numbers"),
+ } else {
+ return nil, &Error{
+ Sender: "filter:pluralize",
+ ErrorMsg: "Filter 'pluralize' does only work on numbers.",
+ }
}
}
@@ -831,8 +807,8 @@ func filterSlice(in *Value, param *Value) (*Value, *Error) {
comp := strings.Split(param.String(), ":")
if len(comp) != 2 {
return nil, &Error{
- Sender: "filter:slice",
- OrigError: errors.New("Slice string must have the format 'from:to' [from/to can be omitted, but the ':' is required]"),
+ Sender: "filter:slice",
+ ErrorMsg: "Slice string must have the format 'from:to' [from/to can be omitted, but the ':' is required]",
}
}
@@ -868,16 +844,16 @@ func filterWordcount(in *Value, param *Value) (*Value, *Error) {
func filterWordwrap(in *Value, param *Value) (*Value, *Error) {
words := strings.Fields(in.String())
- wordsLen := len(words)
- wrapAt := param.Integer()
- if wrapAt <= 0 {
+ words_len := len(words)
+ wrap_at := param.Integer()
+ if wrap_at <= 0 {
return in, nil
}
- linecount := wordsLen/wrapAt + wordsLen%wrapAt
+ linecount := words_len/wrap_at + words_len%wrap_at
lines := make([]string, 0, linecount)
for i := 0; i < linecount; i++ {
- lines = append(lines, strings.Join(words[wrapAt*i:min(wrapAt*(i+1), wordsLen)], " "))
+ lines = append(lines, strings.Join(words[wrap_at*i:min(wrap_at*(i+1), words_len)], " "))
}
return AsValue(strings.Join(lines, "\n")), nil
}
@@ -888,27 +864,27 @@ func filterYesno(in *Value, param *Value) (*Value, *Error) {
1: "no",
2: "maybe",
}
- paramString := param.String()
- customChoices := strings.Split(paramString, ",")
- if len(paramString) > 0 {
- if len(customChoices) > 3 {
+ param_string := param.String()
+ custom_choices := strings.Split(param_string, ",")
+ if len(param_string) > 0 {
+ if len(custom_choices) > 3 {
return nil, &Error{
- Sender: "filter:yesno",
- OrigError: errors.Errorf("You cannot pass more than 3 options to the 'yesno'-filter (got: '%s').", paramString),
+ Sender: "filter:yesno",
+ ErrorMsg: fmt.Sprintf("You cannot pass more than 3 options to the 'yesno'-filter (got: '%s').", param_string),
}
}
- if len(customChoices) < 2 {
+ if len(custom_choices) < 2 {
return nil, &Error{
- Sender: "filter:yesno",
- OrigError: errors.Errorf("You must pass either no or at least 2 arguments to the 'yesno'-filter (got: '%s').", paramString),
+ Sender: "filter:yesno",
+ ErrorMsg: fmt.Sprintf("You must pass either no or at least 2 arguments to the 'yesno'-filter (got: '%s').", param_string),
}
}
// Map to the options now
- choices[0] = customChoices[0]
- choices[1] = customChoices[1]
- if len(customChoices) == 3 {
- choices[2] = customChoices[2]
+ choices[0] = custom_choices[0]
+ choices[1] = custom_choices[1]
+ if len(custom_choices) == 3 {
+ choices[2] = custom_choices[2]
}
}
diff --git a/vendor/github.com/flosch/pongo2/lexer.go b/vendor/github.com/flosch/pongo2/lexer.go
index 36280de..8956f9c 100644
--- a/vendor/github.com/flosch/pongo2/lexer.go
+++ b/vendor/github.com/flosch/pongo2/lexer.go
@@ -4,8 +4,6 @@ import (
"fmt"
"strings"
"unicode/utf8"
-
- "github.com/juju/errors"
)
const (
@@ -65,8 +63,8 @@ type lexer struct {
line int
col int
- inVerbatim bool
- verbatimName string
+ in_verbatim bool
+ verbatim_name string
}
func (t *Token) String() string {
@@ -113,11 +111,11 @@ func lex(name string, input string) ([]*Token, *Error) {
if l.errored {
errtoken := l.tokens[len(l.tokens)-1]
return nil, &Error{
- Filename: name,
- Line: errtoken.Line,
- Column: errtoken.Col,
- Sender: "lexer",
- OrigError: errors.New(errtoken.Val),
+ Filename: name,
+ Line: errtoken.Line,
+ Column: errtoken.Col,
+ Sender: "lexer",
+ ErrorMsg: errtoken.Val,
}
}
return l.tokens, nil
@@ -218,8 +216,8 @@ func (l *lexer) run() {
for {
// TODO: Support verbatim tag names
// https://docs.djangoproject.com/en/dev/ref/templates/builtins/#verbatim
- if l.inVerbatim {
- name := l.verbatimName
+ if l.in_verbatim {
+ name := l.verbatim_name
if name != "" {
name += " "
}
@@ -231,20 +229,20 @@ func (l *lexer) run() {
l.pos += w
l.col += w
l.ignore()
- l.inVerbatim = false
+ l.in_verbatim = false
}
} else if strings.HasPrefix(l.input[l.pos:], "{% verbatim %}") { // tag
if l.pos > l.start {
l.emit(TokenHTML)
}
- l.inVerbatim = true
+ l.in_verbatim = true
w := len("{% verbatim %}")
l.pos += w
l.col += w
l.ignore()
}
- if !l.inVerbatim {
+ if !l.in_verbatim {
// Ignore single-line comments {# ... #}
if strings.HasPrefix(l.input[l.pos:], "{#") {
if l.pos > l.start {
@@ -305,7 +303,7 @@ func (l *lexer) run() {
l.emit(TokenHTML)
}
- if l.inVerbatim {
+ if l.in_verbatim {
l.errorf("verbatim-tag not closed, got EOF.")
}
}
@@ -330,7 +328,7 @@ outer_loop:
return l.stateIdentifier
case l.accept(tokenDigits):
return l.stateNumber
- case l.accept(`"'`):
+ case l.accept(`"`):
return l.stateString
}
@@ -350,6 +348,10 @@ outer_loop:
}
}
+ if l.pos < len(l.input) {
+ return l.errorf("Unknown character: %q (%d)", l.peek(), l.peek())
+ }
+
break
}
@@ -372,11 +374,6 @@ func (l *lexer) stateIdentifier() lexerStateFn {
func (l *lexer) stateNumber() lexerStateFn {
l.acceptRun(tokenDigits)
- if l.accept(tokenIdentifierCharsWithDigits) {
- // This seems to be an identifier starting with a number.
- // See https://github.com/flosch/pongo2/issues/151
- return l.stateIdentifier()
- }
/*
Maybe context-sensitive number lexing?
* comments.0.Text // first comment
@@ -396,10 +393,9 @@ func (l *lexer) stateNumber() lexerStateFn {
}
func (l *lexer) stateString() lexerStateFn {
- quotationMark := l.value()
l.ignore()
- l.startcol-- // we're starting the position at the first "
- for !l.accept(quotationMark) {
+ l.startcol -= 1 // we're starting the position at the first "
+ for !l.accept(`"`) {
switch l.next() {
case '\\':
// escape sequence
diff --git a/vendor/github.com/flosch/pongo2/nodes.go b/vendor/github.com/flosch/pongo2/nodes.go
index 5b039cd..5fd5a6c 100644
--- a/vendor/github.com/flosch/pongo2/nodes.go
+++ b/vendor/github.com/flosch/pongo2/nodes.go
@@ -1,13 +1,17 @@
package pongo2
+import (
+ "bytes"
+)
+
// The root document
type nodeDocument struct {
Nodes []INode
}
-func (doc *nodeDocument) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (doc *nodeDocument) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
for _, n := range doc.Nodes {
- err := n.Execute(ctx, writer)
+ err := n.Execute(ctx, buffer)
if err != nil {
return err
}
diff --git a/vendor/github.com/flosch/pongo2/nodes_html.go b/vendor/github.com/flosch/pongo2/nodes_html.go
index 9680285..9aa630c 100644
--- a/vendor/github.com/flosch/pongo2/nodes_html.go
+++ b/vendor/github.com/flosch/pongo2/nodes_html.go
@@ -1,10 +1,14 @@
package pongo2
+import (
+ "bytes"
+)
+
type nodeHTML struct {
token *Token
}
-func (n *nodeHTML) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
- writer.WriteString(n.token.Val)
+func (n *nodeHTML) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
+ buffer.WriteString(n.token.Val)
return nil
}
diff --git a/vendor/github.com/flosch/pongo2/nodes_wrapper.go b/vendor/github.com/flosch/pongo2/nodes_wrapper.go
index d1bcb8d..9180dc7 100644
--- a/vendor/github.com/flosch/pongo2/nodes_wrapper.go
+++ b/vendor/github.com/flosch/pongo2/nodes_wrapper.go
@@ -1,13 +1,17 @@
package pongo2
+import (
+ "bytes"
+)
+
type NodeWrapper struct {
Endtag string
nodes []INode
}
-func (wrapper *NodeWrapper) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (wrapper *NodeWrapper) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
for _, n := range wrapper.nodes {
- err := n.Execute(ctx, writer)
+ err := n.Execute(ctx, buffer)
if err != nil {
return err
}
diff --git a/vendor/github.com/flosch/pongo2/parser.go b/vendor/github.com/flosch/pongo2/parser.go
index d0e08b5..c85e2d2 100644
--- a/vendor/github.com/flosch/pongo2/parser.go
+++ b/vendor/github.com/flosch/pongo2/parser.go
@@ -1,14 +1,13 @@
package pongo2
import (
+ "bytes"
"fmt"
"strings"
-
- "github.com/juju/errors"
)
type INode interface {
- Execute(*ExecutionContext, TemplateWriter) *Error
+ Execute(*ExecutionContext, *bytes.Buffer) *Error
}
type IEvaluator interface {
@@ -28,10 +27,10 @@ type IEvaluator interface {
//
// (See Token's documentation for more about tokens)
type Parser struct {
- name string
- idx int
- tokens []*Token
- lastToken *Token
+ name string
+ idx int
+ tokens []*Token
+ last_token *Token
// if the parser parses a template document, here will be
// a reference to it (needed to access the template through Tags)
@@ -48,7 +47,7 @@ func newParser(name string, tokens []*Token, template *Template) *Parser {
template: template,
}
if len(tokens) > 0 {
- p.lastToken = tokens[len(tokens)-1]
+ p.last_token = tokens[len(tokens)-1]
}
return p
}
@@ -176,7 +175,7 @@ func (p *Parser) GetR(shift int) *Token {
return p.Get(i)
}
-// Error produces a nice error message and returns an error-object.
+// Produces a nice error message and returns an error-object.
// The 'token'-argument is optional. If provided, it will take
// the token's position information. If not provided, it will
// automatically use the CURRENT token's position information.
@@ -197,13 +196,13 @@ func (p *Parser) Error(msg string, token *Token) *Error {
col = token.Col
}
return &Error{
- Template: p.template,
- Filename: p.name,
- Sender: "parser",
- Line: line,
- Column: col,
- Token: token,
- OrigError: errors.New(msg),
+ Template: p.template,
+ Filename: p.name,
+ Sender: "parser",
+ Line: line,
+ Column: col,
+ Token: token,
+ ErrorMsg: msg,
}
}
@@ -213,19 +212,19 @@ func (p *Parser) Error(msg string, token *Token) *Error {
func (p *Parser) WrapUntilTag(names ...string) (*NodeWrapper, *Parser, *Error) {
wrapper := &NodeWrapper{}
- var tagArgs []*Token
+ tagArgs := make([]*Token, 0)
for p.Remaining() > 0 {
// New tag, check whether we have to stop wrapping here
if p.Peek(TokenSymbol, "{%") != nil {
- tagIdent := p.PeekTypeN(1, TokenIdentifier)
+ tag_ident := p.PeekTypeN(1, TokenIdentifier)
- if tagIdent != nil {
+ if tag_ident != nil {
// We've found a (!) end-tag
found := false
for _, n := range names {
- if tagIdent.Val == n {
+ if tag_ident.Val == n {
found = true
break
}
@@ -239,15 +238,16 @@ func (p *Parser) WrapUntilTag(names ...string) (*NodeWrapper, *Parser, *Error) {
for {
if p.Match(TokenSymbol, "%}") != nil {
// Okay, end the wrapping here
- wrapper.Endtag = tagIdent.Val
+ wrapper.Endtag = tag_ident.Val
return wrapper, newParser(p.template.name, tagArgs, p.template), nil
+ } else {
+ t := p.Current()
+ p.Consume()
+ if t == nil {
+ return nil, nil, p.Error("Unexpected EOF.", p.last_token)
+ }
+ tagArgs = append(tagArgs, t)
}
- t := p.Current()
- p.Consume()
- if t == nil {
- return nil, nil, p.Error("Unexpected EOF.", p.lastToken)
- }
- tagArgs = append(tagArgs, t)
}
}
}
@@ -263,47 +263,5 @@ func (p *Parser) WrapUntilTag(names ...string) (*NodeWrapper, *Parser, *Error) {
}
return nil, nil, p.Error(fmt.Sprintf("Unexpected EOF, expected tag %s.", strings.Join(names, " or ")),
- p.lastToken)
-}
-
-// Skips all nodes between starting tag and "{% endtag %}"
-func (p *Parser) SkipUntilTag(names ...string) *Error {
- for p.Remaining() > 0 {
- // New tag, check whether we have to stop wrapping here
- if p.Peek(TokenSymbol, "{%") != nil {
- tagIdent := p.PeekTypeN(1, TokenIdentifier)
-
- if tagIdent != nil {
- // We've found a (!) end-tag
-
- found := false
- for _, n := range names {
- if tagIdent.Val == n {
- found = true
- break
- }
- }
-
- // We only process the tag if we've found an end tag
- if found {
- // Okay, endtag found.
- p.ConsumeN(2) // '{%' tagname
-
- for {
- if p.Match(TokenSymbol, "%}") != nil {
- // Done skipping, exit.
- return nil
- }
- }
- }
- }
- }
- t := p.Current()
- p.Consume()
- if t == nil {
- return p.Error("Unexpected EOF.", p.lastToken)
- }
- }
-
- return p.Error(fmt.Sprintf("Unexpected EOF, expected tag %s.", strings.Join(names, " or ")), p.lastToken)
+ p.last_token)
}
diff --git a/vendor/github.com/flosch/pongo2/parser_expression.go b/vendor/github.com/flosch/pongo2/parser_expression.go
index 988468e..c1002de 100644
--- a/vendor/github.com/flosch/pongo2/parser_expression.go
+++ b/vendor/github.com/flosch/pongo2/parser_expression.go
@@ -1,37 +1,38 @@
package pongo2
import (
+ "bytes"
"fmt"
"math"
)
type Expression struct {
// TODO: Add location token?
- expr1 IEvaluator
- expr2 IEvaluator
- opToken *Token
+ expr1 IEvaluator
+ expr2 IEvaluator
+ op_token *Token
}
type relationalExpression struct {
// TODO: Add location token?
- expr1 IEvaluator
- expr2 IEvaluator
- opToken *Token
+ expr1 IEvaluator
+ expr2 IEvaluator
+ op_token *Token
}
type simpleExpression struct {
- negate bool
- negativeSign bool
- term1 IEvaluator
- term2 IEvaluator
- opToken *Token
+ negate bool
+ negative_sign bool
+ term1 IEvaluator
+ term2 IEvaluator
+ op_token *Token
}
type term struct {
// TODO: Add location token?
- factor1 IEvaluator
- factor2 IEvaluator
- opToken *Token
+ factor1 IEvaluator
+ factor2 IEvaluator
+ op_token *Token
}
type power struct {
@@ -55,14 +56,14 @@ func (expr *simpleExpression) FilterApplied(name string) bool {
(expr.term2 != nil && expr.term2.FilterApplied(name)))
}
-func (expr *term) FilterApplied(name string) bool {
- return expr.factor1.FilterApplied(name) && (expr.factor2 == nil ||
- (expr.factor2 != nil && expr.factor2.FilterApplied(name)))
+func (t *term) FilterApplied(name string) bool {
+ return t.factor1.FilterApplied(name) && (t.factor2 == nil ||
+ (t.factor2 != nil && t.factor2.FilterApplied(name)))
}
-func (expr *power) FilterApplied(name string) bool {
- return expr.power1.FilterApplied(name) && (expr.power2 == nil ||
- (expr.power2 != nil && expr.power2.FilterApplied(name)))
+func (p *power) FilterApplied(name string) bool {
+ return p.power1.FilterApplied(name) && (p.power2 == nil ||
+ (p.power2 != nil && p.power2.FilterApplied(name)))
}
func (expr *Expression) GetPositionToken() *Token {
@@ -85,48 +86,48 @@ func (expr *power) GetPositionToken() *Token {
return expr.power1.GetPositionToken()
}
-func (expr *Expression) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (expr *Expression) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
value, err := expr.Evaluate(ctx)
if err != nil {
return err
}
- writer.WriteString(value.String())
+ buffer.WriteString(value.String())
return nil
}
-func (expr *relationalExpression) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (expr *relationalExpression) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
value, err := expr.Evaluate(ctx)
if err != nil {
return err
}
- writer.WriteString(value.String())
+ buffer.WriteString(value.String())
return nil
}
-func (expr *simpleExpression) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (expr *simpleExpression) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
value, err := expr.Evaluate(ctx)
if err != nil {
return err
}
- writer.WriteString(value.String())
+ buffer.WriteString(value.String())
return nil
}
-func (expr *term) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (expr *term) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
value, err := expr.Evaluate(ctx)
if err != nil {
return err
}
- writer.WriteString(value.String())
+ buffer.WriteString(value.String())
return nil
}
-func (expr *power) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error {
+func (expr *power) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error {
value, err := expr.Evaluate(ctx)
if err != nil {
return err
}
- writer.WriteString(value.String())
+ buffer.WriteString(value.String())
return nil
}
@@ -140,13 +141,13 @@ func (expr *Expression) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
if err != nil {
return nil, err
}
- switch expr.opToken.Val {
+ switch expr.op_token.Val {
case "and", "&&":
return AsValue(v1.IsTrue() && v2.IsTrue()), nil
case "or", "||":
return AsValue(v1.IsTrue() || v2.IsTrue()), nil
default:
- return nil, ctx.Error(fmt.Sprintf("unimplemented: %s", expr.opToken.Val), expr.opToken)
+ panic(fmt.Sprintf("unimplemented: %s", expr.op_token.Val))
}
} else {
return v1, nil
@@ -163,35 +164,39 @@ func (expr *relationalExpression) Evaluate(ctx *ExecutionContext) (*Value, *Erro
if err != nil {
return nil, err
}
- switch expr.opToken.Val {
+ switch expr.op_token.Val {
case "<=":
if v1.IsFloat() || v2.IsFloat() {
return AsValue(v1.Float() <= v2.Float()), nil
+ } else {
+ return AsValue(v1.Integer() <= v2.Integer()), nil
}
- return AsValue(v1.Integer() <= v2.Integer()), nil
case ">=":
if v1.IsFloat() || v2.IsFloat() {
return AsValue(v1.Float() >= v2.Float()), nil
+ } else {
+ return AsValue(v1.Integer() >= v2.Integer()), nil
}
- return AsValue(v1.Integer() >= v2.Integer()), nil
case "==":
return AsValue(v1.EqualValueTo(v2)), nil
case ">":
if v1.IsFloat() || v2.IsFloat() {
return AsValue(v1.Float() > v2.Float()), nil
+ } else {
+ return AsValue(v1.Integer() > v2.Integer()), nil
}
- return AsValue(v1.Integer() > v2.Integer()), nil
case "<":
if v1.IsFloat() || v2.IsFloat() {
return AsValue(v1.Float() < v2.Float()), nil
+ } else {
+ return AsValue(v1.Integer() < v2.Integer()), nil
}
- return AsValue(v1.Integer() < v2.Integer()), nil
case "!=", "<>":
return AsValue(!v1.EqualValueTo(v2)), nil
case "in":
return AsValue(v2.Contains(v1)), nil
default:
- return nil, ctx.Error(fmt.Sprintf("unimplemented: %s", expr.opToken.Val), expr.opToken)
+ panic(fmt.Sprintf("unimplemented: %s", expr.op_token.Val))
}
} else {
return v1, nil
@@ -209,7 +214,7 @@ func (expr *simpleExpression) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
result = result.Negate()
}
- if expr.negativeSign {
+ if expr.negative_sign {
if result.IsNumber() {
switch {
case result.IsFloat():
@@ -217,7 +222,7 @@ func (expr *simpleExpression) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
case result.IsInteger():
result = AsValue(-1 * result.Integer())
default:
- return nil, ctx.Error("Operation between a number and a non-(float/integer) is not possible", nil)
+ panic("not possible")
}
} else {
return nil, ctx.Error("Negative sign on a non-number expression", expr.GetPositionToken())
@@ -229,40 +234,42 @@ func (expr *simpleExpression) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
if err != nil {
return nil, err
}
- switch expr.opToken.Val {
+ switch expr.op_token.Val {
case "+":
if result.IsFloat() || t2.IsFloat() {
// Result will be a float
return AsValue(result.Float() + t2.Float()), nil
+ } else {
+ // Result will be an integer
+ return AsValue(result.Integer() + t2.Integer()), nil
}
- // Result will be an integer
- return AsValue(result.Integer() + t2.Integer()), nil
case "-":
if result.IsFloat() || t2.IsFloat() {
// Result will be a float
return AsValue(result.Float() - t2.Float()), nil
+ } else {
+ // Result will be an integer
+ return AsValue(result.Integer() - t2.Integer()), nil
}
- // Result will be an integer
- return AsValue(result.Integer() - t2.Integer()), nil
default:
- return nil, ctx.Error("Unimplemented", expr.GetPositionToken())
+ panic("unimplemented")
}
}
return result, nil
}
-func (expr *term) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
- f1, err := expr.factor1.Evaluate(ctx)
+func (t *term) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
+ f1, err := t.factor1.Evaluate(ctx)
if err != nil {
return nil, err
}
- if expr.factor2 != nil {
- f2, err := expr.factor2.Evaluate(ctx)
+ if t.factor2 != nil {
+ f2, err := t.factor2.Evaluate(ctx)
if err != nil {
return nil, err
}
- switch expr.opToken.Val {
+ switch t.op_token.Val {
case "*":
if f1.IsFloat() || f2.IsFloat() {
// Result will be float
@@ -281,26 +288,27 @@ func (expr *term) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
// Result will be int
return AsValue(f1.Integer() % f2.Integer()), nil
default:
- return nil, ctx.Error("unimplemented", expr.opToken)
+ panic("unimplemented")
}
} else {
return f1, nil
}
}
-func (expr *power) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
- p1, err := expr.power1.Evaluate(ctx)
+func (pw *power) Evaluate(ctx *ExecutionContext) (*Value, *Error) {
+ p1, err := pw.power1.Evaluate(ctx)
if err != nil {
return nil, err
}
- if expr.power2 != nil {
- p2, err := expr.power2.Evaluate(ctx)
+ if pw.power2 != nil {
+ p2, err := pw.power2.Evaluate(ctx)
if err != nil {
return nil, err
}
return AsValue(math.Pow(p1.Float(), p2.Float())), nil
+ } else {
+ return p1, nil
}
- return p1, nil
}
func (p *Parser) parseFactor() (IEvaluator, *Error) {
@@ -344,19 +352,19 @@ func (p *Parser) parsePower() (IEvaluator, *Error) {
}
func (p *Parser) parseTerm() (IEvaluator, *Error) {
- returnTerm := new(term)
+ return_term := new(term)
factor1, err := p.parsePower()
if err != nil {
return nil, err
}
- returnTerm.factor1 = factor1
+ return_term.factor1 = factor1
for p.PeekOne(TokenSymbol, "*", "/", "%") != nil {
- if returnTerm.opToken != nil {
+ if return_term.op_token != nil {
// Create new sub-term
- returnTerm = &term{
- factor1: returnTerm,
+ return_term = &term{
+ factor1: return_term,
}
}
@@ -368,16 +376,16 @@ func (p *Parser) parseTerm() (IEvaluator, *Error) {
return nil, err
}
- returnTerm.opToken = op
- returnTerm.factor2 = factor2
+ return_term.op_token = op
+ return_term.factor2 = factor2
}
- if returnTerm.opToken == nil {
+ if return_term.op_token == nil {
// Shortcut for faster evaluation
- return returnTerm.factor1, nil
+ return return_term.factor1, nil
}
- return returnTerm, nil
+ return return_term, nil
}
func (p *Parser) parseSimpleExpression() (IEvaluator, *Error) {
@@ -385,7 +393,7 @@ func (p *Parser) parseSimpleExpression() (IEvaluator, *Error) {
if sign := p.MatchOne(TokenSymbol, "+", "-"); sign != nil {
if sign.Val == "-" {
- expr.negativeSign = true
+ expr.negative_sign = true
}
}
@@ -400,7 +408,7 @@ func (p *Parser) parseSimpleExpression() (IEvaluator, *Error) {
expr.term1 = term1
for p.PeekOne(TokenSymbol, "+", "-") != nil {
- if expr.opToken != nil {
+ if expr.op_token != nil {
// New sub expr
expr = &simpleExpression{
term1: expr,
@@ -416,10 +424,10 @@ func (p *Parser) parseSimpleExpression() (IEvaluator, *Error) {
}
expr.term2 = term2
- expr.opToken = op
+ expr.op_token = op
}
- if expr.negate == false && expr.negativeSign == false && expr.term2 == nil {
+ if expr.negate == false && expr.negative_sign == false && expr.term2 == nil {
// Shortcut for faster evaluation
return expr.term1, nil
}
@@ -442,14 +450,14 @@ func (p *Parser) parseRelationalExpression() (IEvaluator, *Error) {
if err != nil {
return nil, err
}
- expr.opToken = t
+ expr.op_token = t
expr.expr2 = expr2
} else if t := p.MatchOne(TokenKeyword, "in"); t != nil {
expr2, err := p.parseSimpleExpression()
if err != nil {
return nil, err
}
- expr.opToken = t
+ expr.op_token = t
expr.expr2 = expr2
}
@@ -479,7 +487,7 @@ func (p *Parser) ParseExpression() (IEvaluator, *Error) {
return nil, err
}
exp.expr2 = expr2
- exp.opToken = op
+ exp.op_token = op
}
if exp.expr2 == nil {
diff --git a/vendor/github.com/flosch/pongo2/pongo2.go b/vendor/github.com/flosch/pongo2/pongo2.go
index eda3aa0..e61faa4 100644
--- a/vendor/github.com/flosch/pongo2/pongo2.go
+++ b/vendor/github.com/flosch/pongo2/pongo2.go
@@ -1,10 +1,10 @@
package pongo2
// Version string
-const Version = "dev"
+const Version = "v3"
-// Must panics, if a Template couldn't successfully parsed. This is how you
-// would use it:
+// Helper function which panics, if a Template couldn't
+// successfully parsed. This is how you would use it:
// var baseTemplate = pongo2.Must(pongo2.FromFile("templates/base.html"))
func Must(tpl *Template, err error) *Template {
if err != nil {
diff --git a/vendor/github.com/flosch/pongo2/pongo2_issues_test.go b/vendor/github.com/flosch/pongo2/pongo2_issues_test.go
deleted file mode 100644
index 725ab41..0000000
--- a/vendor/github.com/flosch/pongo2/pongo2_issues_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package pongo2_test
-
-import (
- "testing"
-
- "github.com/flosch/pongo2"
-)
-
-func TestIssue151(t *testing.T) {
- tpl, err := pongo2.FromString("{{ mydict.51232_3 }}{{ 12345_123}}{{ 995189baz }}")
- if err != nil {
- t.Fatal(err)
- }
-
- str, err := tpl.Execute(pongo2.Context{
- "mydict": map[string]string{
- "51232_3": "foo",
- },
- "12345_123": "bar",
- "995189baz": "baz",
- })
- if err != nil {
- t.Fatal(err)
- }
-
- if str != "foobarbaz" {
- t.Fatalf("Expected output 'foobarbaz', but got '%s'.", str)
- }
-}
diff --git a/vendor/github.com/flosch/pongo2/pongo2_template_test.go b/vendor/github.com/flosch/pongo2/pongo2_template_test.go
deleted file mode 100644
index 4b7d8fa..0000000
--- a/vendor/github.com/flosch/pongo2/pongo2_template_test.go
+++ /dev/null
@@ -1,534 +0,0 @@
-package pongo2_test
-
-import (
- "bytes"
- "fmt"
- "io/ioutil"
- "path/filepath"
- "regexp"
- "strings"
- "testing"
- "time"
-
- "github.com/flosch/pongo2"
-)
-
-var adminList = []string{"user2"}
-
-var time1 = time.Date(2014, 06, 10, 15, 30, 15, 0, time.UTC)
-var time2 = time.Date(2011, 03, 21, 8, 37, 56, 12, time.UTC)
-
-type post struct {
- Text string
- Created time.Time
-}
-
-type user struct {
- Name string
- Validated bool
-}
-
-type comment struct {
- Author *user
- Date time.Time
- Text string
-}
-
-func isAdmin(u *user) bool {
- for _, a := range adminList {
- if a == u.Name {
- return true
- }
- }
- return false
-}
-
-func (u *user) Is_admin() *pongo2.Value {
- return pongo2.AsValue(isAdmin(u))
-}
-
-func (u *user) Is_admin2() bool {
- return isAdmin(u)
-}
-
-func (p *post) String() string {
- return ":-)"
-}
-
-/*
- * Start setup sandbox
- */
-
-type tagSandboxDemoTag struct {
-}
-
-func (node *tagSandboxDemoTag) Execute(ctx *pongo2.ExecutionContext, writer pongo2.TemplateWriter) *pongo2.Error {
- writer.WriteString("hello")
- return nil
-}
-
-func tagSandboxDemoTagParser(doc *pongo2.Parser, start *pongo2.Token, arguments *pongo2.Parser) (pongo2.INodeTag, *pongo2.Error) {
- return &tagSandboxDemoTag{}, nil
-}
-
-func BannedFilterFn(in *pongo2.Value, params *pongo2.Value) (*pongo2.Value, *pongo2.Error) {
- return in, nil
-}
-
-func init() {
- pongo2.DefaultSet.Debug = true
-
- pongo2.RegisterFilter("banned_filter", BannedFilterFn)
- pongo2.RegisterFilter("unbanned_filter", BannedFilterFn)
- pongo2.RegisterTag("banned_tag", tagSandboxDemoTagParser)
- pongo2.RegisterTag("unbanned_tag", tagSandboxDemoTagParser)
-
- pongo2.DefaultSet.BanFilter("banned_filter")
- pongo2.DefaultSet.BanTag("banned_tag")
-
- f, err := ioutil.TempFile("/tmp/", "pongo2_")
- if err != nil {
- panic("cannot write to /tmp/")
- }
- f.Write([]byte("Hello from pongo2"))
- pongo2.DefaultSet.Globals["temp_file"] = f.Name()
-}
-
-/*
- * End setup sandbox
- */
-
-var tplContext = pongo2.Context{
- "number": 11,
- "simple": map[string]interface{}{
- "number": 42,
- "name": "john doe",
- "included_file": "INCLUDES.helper",
- "included_file_not_exists": "INCLUDES.helper.not_exists",
- "nil": nil,
- "uint": uint(8),
- "float": float64(3.1415),
- "str": "string",
- "chinese_hello_world": "你好世界",
- "bool_true": true,
- "bool_false": false,
- "newline_text": `this is a text
-with a new line in it`,
- "long_text": `This is a simple text.
-
-This too, as a paragraph.
-Right?
-
-Yep!`,
- "escape_js_test": `escape sequences \r\n\'\" special chars "?!=$<>`,
- "one_item_list": []int{99},
- "multiple_item_list": []int{1, 1, 2, 3, 5, 8, 13, 21, 34, 55},
- "unsorted_int_list": []int{192, 581, 22, 1, 249, 9999, 1828591, 8271},
- "fixed_item_list": [...]int{1, 2, 3, 4},
- "misc_list": []interface{}{"Hello", 99, 3.14, "good"},
- "escape_text": "This is \\a Test. \"Yep\". 'Yep'.",
- "xss": "",
- "intmap": map[int]string{
- 1: "one",
- 5: "five",
- 2: "two",
- },
- "strmap": map[string]string{
- "abc": "def",
- "bcd": "efg",
- "zab": "cde",
- "gh": "kqm",
- "ukq": "qqa",
- "aab": "aba",
- },
- "func_add": func(a, b int) int {
- return a + b
- },
- "func_add_iface": func(a, b interface{}) interface{} {
- return a.(int) + b.(int)
- },
- "func_variadic": func(msg string, args ...interface{}) string {
- return fmt.Sprintf(msg, args...)
- },
- "func_variadic_sum_int": func(args ...int) int {
- // Create a sum
- s := 0
- for _, i := range args {
- s += i
- }
- return s
- },
- "func_variadic_sum_int2": func(args ...*pongo2.Value) *pongo2.Value {
- // Create a sum
- s := 0
- for _, i := range args {
- s += i.Integer()
- }
- return pongo2.AsValue(s)
- },
- },
- "complex": map[string]interface{}{
- "is_admin": isAdmin,
- "post": post{
- Text: "Hello!
") + buffer.WriteString("
") par := tagLoremParagraphs[i%len(tagLoremParagraphs)] - writer.WriteString(par) - writer.WriteString("
") + buffer.WriteString(par) + buffer.WriteString("") } } default: - return ctx.OrigError(errors.Errorf("unsupported method: %s", node.method), nil) + panic("unsupported method") } return nil } func tagLoremParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - loremNode := &tagLoremNode{ + lorem_node := &tagLoremNode{ position: start, count: 1, method: "b", } - if countToken := arguments.MatchType(TokenNumber); countToken != nil { - loremNode.count = AsValue(countToken.Val).Integer() + if count_token := arguments.MatchType(TokenNumber); count_token != nil { + lorem_node.count = AsValue(count_token.Val).Integer() } - if methodToken := arguments.MatchType(TokenIdentifier); methodToken != nil { - if methodToken.Val != "w" && methodToken.Val != "p" && methodToken.Val != "b" { + if method_token := arguments.MatchType(TokenIdentifier); method_token != nil { + if method_token.Val != "w" && method_token.Val != "p" && method_token.Val != "b" { return nil, arguments.Error("lorem-method must be either 'w', 'p' or 'b'.", nil) } - loremNode.method = methodToken.Val + lorem_node.method = method_token.Val } if arguments.MatchOne(TokenIdentifier, "random") != nil { - loremNode.random = true + lorem_node.random = true } if arguments.Remaining() > 0 { return nil, arguments.Error("Malformed lorem-tag arguments.", nil) } - return loremNode, nil + return lorem_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_macro.go b/vendor/github.com/flosch/pongo2/tags_macro.go index dd3e0bf..41cba99 100644 --- a/vendor/github.com/flosch/pongo2/tags_macro.go +++ b/vendor/github.com/flosch/pongo2/tags_macro.go @@ -6,16 +6,16 @@ import ( ) type tagMacroNode struct { - position *Token - name string - argsOrder []string - args map[string]IEvaluator - exported bool + position *Token + name string + args_order []string + args map[string]IEvaluator + exported bool wrapper *NodeWrapper } -func (node *tagMacroNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagMacroNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { ctx.Private[node.name] = func(args ...*Value) *Value { return node.call(ctx, args...) } @@ -24,28 +24,28 @@ func (node *tagMacroNode) Execute(ctx *ExecutionContext, writer TemplateWriter) } func (node *tagMacroNode) call(ctx *ExecutionContext, args ...*Value) *Value { - argsCtx := make(Context) + args_ctx := make(Context) for k, v := range node.args { if v == nil { // User did not provided a default value - argsCtx[k] = nil + args_ctx[k] = nil } else { // Evaluate the default value - valueExpr, err := v.Evaluate(ctx) + value_expr, err := v.Evaluate(ctx) if err != nil { ctx.Logf(err.Error()) return AsSafeValue(err.Error()) } - argsCtx[k] = valueExpr + args_ctx[k] = value_expr } } - if len(args) > len(node.argsOrder) { + if len(args) > len(node.args_order) { // Too many arguments, we're ignoring them and just logging into debug mode. err := ctx.Error(fmt.Sprintf("Macro '%s' called with too many arguments (%d instead of %d).", - node.name, len(args), len(node.argsOrder)), nil).updateFromTokenIfNeeded(ctx.template, node.position) + node.name, len(args), len(node.args_order)), nil).updateFromTokenIfNeeded(ctx.template, node.position) ctx.Logf(err.Error()) // TODO: This is a workaround, because the error is not returned yet to the Execution()-methods return AsSafeValue(err.Error()) @@ -55,10 +55,10 @@ func (node *tagMacroNode) call(ctx *ExecutionContext, args ...*Value) *Value { macroCtx := NewChildExecutionContext(ctx) // Register all arguments in the private context - macroCtx.Private.Update(argsCtx) + macroCtx.Private.Update(args_ctx) - for idx, argValue := range args { - macroCtx.Private[node.argsOrder[idx]] = argValue.Interface() + for idx, arg_value := range args { + macroCtx.Private[node.args_order[idx]] = arg_value.Interface() } var b bytes.Buffer @@ -71,38 +71,38 @@ func (node *tagMacroNode) call(ctx *ExecutionContext, args ...*Value) *Value { } func tagMacroParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - macroNode := &tagMacroNode{ + macro_node := &tagMacroNode{ position: start, args: make(map[string]IEvaluator), } - nameToken := arguments.MatchType(TokenIdentifier) - if nameToken == nil { + name_token := arguments.MatchType(TokenIdentifier) + if name_token == nil { return nil, arguments.Error("Macro-tag needs at least an identifier as name.", nil) } - macroNode.name = nameToken.Val + macro_node.name = name_token.Val if arguments.MatchOne(TokenSymbol, "(") == nil { return nil, arguments.Error("Expected '('.", nil) } for arguments.Match(TokenSymbol, ")") == nil { - argNameToken := arguments.MatchType(TokenIdentifier) - if argNameToken == nil { + arg_name_token := arguments.MatchType(TokenIdentifier) + if arg_name_token == nil { return nil, arguments.Error("Expected argument name as identifier.", nil) } - macroNode.argsOrder = append(macroNode.argsOrder, argNameToken.Val) + macro_node.args_order = append(macro_node.args_order, arg_name_token.Val) if arguments.Match(TokenSymbol, "=") != nil { // Default expression follows - argDefaultExpr, err := arguments.ParseExpression() + arg_default_expr, err := arguments.ParseExpression() if err != nil { return nil, err } - macroNode.args[argNameToken.Val] = argDefaultExpr + macro_node.args[arg_name_token.Val] = arg_default_expr } else { // No default expression - macroNode.args[argNameToken.Val] = nil + macro_node.args[arg_name_token.Val] = nil } if arguments.Match(TokenSymbol, ")") != nil { @@ -114,7 +114,7 @@ func tagMacroParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Er } if arguments.Match(TokenKeyword, "export") != nil { - macroNode.exported = true + macro_node.exported = true } if arguments.Remaining() > 0 { @@ -126,22 +126,22 @@ func tagMacroParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Er if err != nil { return nil, err } - macroNode.wrapper = wrapper + macro_node.wrapper = wrapper if endargs.Count() > 0 { return nil, endargs.Error("Arguments not allowed here.", nil) } - if macroNode.exported { + if macro_node.exported { // Now register the macro if it wants to be exported - _, has := doc.template.exportedMacros[macroNode.name] + _, has := doc.template.exported_macros[macro_node.name] if has { - return nil, doc.Error(fmt.Sprintf("another macro with name '%s' already exported", macroNode.name), start) + return nil, doc.Error(fmt.Sprintf("Another macro with name '%s' already exported.", macro_node.name), start) } - doc.template.exportedMacros[macroNode.name] = macroNode + doc.template.exported_macros[macro_node.name] = macro_node } - return macroNode, nil + return macro_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_now.go b/vendor/github.com/flosch/pongo2/tags_now.go index d9fa4a3..0f4320f 100644 --- a/vendor/github.com/flosch/pongo2/tags_now.go +++ b/vendor/github.com/flosch/pongo2/tags_now.go @@ -1,6 +1,7 @@ package pongo2 import ( + "bytes" "time" ) @@ -10,7 +11,7 @@ type tagNowNode struct { fake bool } -func (node *tagNowNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagNowNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { var t time.Time if node.fake { t = time.Date(2014, time.February, 05, 18, 31, 45, 00, time.UTC) @@ -18,31 +19,31 @@ func (node *tagNowNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *E t = time.Now() } - writer.WriteString(t.Format(node.format)) + buffer.WriteString(t.Format(node.format)) return nil } func tagNowParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - nowNode := &tagNowNode{ + now_node := &tagNowNode{ position: start, } - formatToken := arguments.MatchType(TokenString) - if formatToken == nil { + format_token := arguments.MatchType(TokenString) + if format_token == nil { return nil, arguments.Error("Expected a format string.", nil) } - nowNode.format = formatToken.Val + now_node.format = format_token.Val if arguments.MatchOne(TokenIdentifier, "fake") != nil { - nowNode.fake = true + now_node.fake = true } if arguments.Remaining() > 0 { return nil, arguments.Error("Malformed now-tag arguments.", nil) } - return nowNode, nil + return now_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_set.go b/vendor/github.com/flosch/pongo2/tags_set.go index be121c1..2729f44 100644 --- a/vendor/github.com/flosch/pongo2/tags_set.go +++ b/vendor/github.com/flosch/pongo2/tags_set.go @@ -1,11 +1,13 @@ package pongo2 +import "bytes" + type tagSetNode struct { name string expression IEvaluator } -func (node *tagSetNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagSetNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { // Evaluate expression value, err := node.expression.Evaluate(ctx) if err != nil { diff --git a/vendor/github.com/flosch/pongo2/tags_spaceless.go b/vendor/github.com/flosch/pongo2/tags_spaceless.go index 4fa851b..a4b3003 100644 --- a/vendor/github.com/flosch/pongo2/tags_spaceless.go +++ b/vendor/github.com/flosch/pongo2/tags_spaceless.go @@ -11,7 +11,7 @@ type tagSpacelessNode struct { var tagSpacelessRegexp = regexp.MustCompile(`(?U:(<.*>))([\t\n\v\f\r ]+)(?U:(<.*>))`) -func (node *tagSpacelessNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagSpacelessNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { b := bytes.NewBuffer(make([]byte, 0, 1024)) // 1 KiB err := node.wrapper.Execute(ctx, b) @@ -28,25 +28,25 @@ func (node *tagSpacelessNode) Execute(ctx *ExecutionContext, writer TemplateWrit s = s2 } - writer.WriteString(s) + buffer.WriteString(s) return nil } func tagSpacelessParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - spacelessNode := &tagSpacelessNode{} + spaceless_node := &tagSpacelessNode{} wrapper, _, err := doc.WrapUntilTag("endspaceless") if err != nil { return nil, err } - spacelessNode.wrapper = wrapper + spaceless_node.wrapper = wrapper if arguments.Remaining() > 0 { return nil, arguments.Error("Malformed spaceless-tag arguments.", nil) } - return spacelessNode, nil + return spaceless_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_ssi.go b/vendor/github.com/flosch/pongo2/tags_ssi.go index c33858d..3c3894f 100644 --- a/vendor/github.com/flosch/pongo2/tags_ssi.go +++ b/vendor/github.com/flosch/pongo2/tags_ssi.go @@ -1,6 +1,7 @@ package pongo2 import ( + "bytes" "io/ioutil" ) @@ -10,47 +11,47 @@ type tagSSINode struct { template *Template } -func (node *tagSSINode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagSSINode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { if node.template != nil { // Execute the template within the current context includeCtx := make(Context) includeCtx.Update(ctx.Public) includeCtx.Update(ctx.Private) - err := node.template.execute(includeCtx, writer) + err := node.template.ExecuteWriter(includeCtx, buffer) if err != nil { return err.(*Error) } } else { // Just print out the content - writer.WriteString(node.content) + buffer.WriteString(node.content) } return nil } func tagSSIParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - SSINode := &tagSSINode{} + ssi_node := &tagSSINode{} - if fileToken := arguments.MatchType(TokenString); fileToken != nil { - SSINode.filename = fileToken.Val + if file_token := arguments.MatchType(TokenString); file_token != nil { + ssi_node.filename = file_token.Val if arguments.Match(TokenIdentifier, "parsed") != nil { // parsed - temporaryTpl, err := doc.template.set.FromFile(doc.template.set.resolveFilename(doc.template, fileToken.Val)) + temporary_tpl, err := doc.template.set.FromFile(doc.template.set.resolveFilename(doc.template, file_token.Val)) if err != nil { - return nil, err.(*Error).updateFromTokenIfNeeded(doc.template, fileToken) + return nil, err.(*Error).updateFromTokenIfNeeded(doc.template, file_token) } - SSINode.template = temporaryTpl + ssi_node.template = temporary_tpl } else { // plaintext - buf, err := ioutil.ReadFile(doc.template.set.resolveFilename(doc.template, fileToken.Val)) + buf, err := ioutil.ReadFile(doc.template.set.resolveFilename(doc.template, file_token.Val)) if err != nil { return nil, (&Error{ - Sender: "tag:ssi", - OrigError: err, - }).updateFromTokenIfNeeded(doc.template, fileToken) + Sender: "tag:ssi", + ErrorMsg: err.Error(), + }).updateFromTokenIfNeeded(doc.template, file_token) } - SSINode.content = string(buf) + ssi_node.content = string(buf) } } else { return nil, arguments.Error("First argument must be a string.", nil) @@ -60,7 +61,7 @@ func tagSSIParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Erro return nil, arguments.Error("Malformed SSI-tag argument.", nil) } - return SSINode, nil + return ssi_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_templatetag.go b/vendor/github.com/flosch/pongo2/tags_templatetag.go index 164b4dc..ffd3d9d 100644 --- a/vendor/github.com/flosch/pongo2/tags_templatetag.go +++ b/vendor/github.com/flosch/pongo2/tags_templatetag.go @@ -1,5 +1,9 @@ package pongo2 +import ( + "bytes" +) + type tagTemplateTagNode struct { content string } @@ -15,20 +19,20 @@ var templateTagMapping = map[string]string{ "closecomment": "#}", } -func (node *tagTemplateTagNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { - writer.WriteString(node.content) +func (node *tagTemplateTagNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { + buffer.WriteString(node.content) return nil } func tagTemplateTagParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - ttNode := &tagTemplateTagNode{} + tt_node := &tagTemplateTagNode{} - if argToken := arguments.MatchType(TokenIdentifier); argToken != nil { - output, found := templateTagMapping[argToken.Val] + if arg_token := arguments.MatchType(TokenIdentifier); arg_token != nil { + output, found := templateTagMapping[arg_token.Val] if !found { - return nil, arguments.Error("Argument not found", argToken) + return nil, arguments.Error("Argument not found", arg_token) } - ttNode.content = output + tt_node.content = output } else { return nil, arguments.Error("Identifier expected.", nil) } @@ -37,7 +41,7 @@ func tagTemplateTagParser(doc *Parser, start *Token, arguments *Parser) (INodeTa return nil, arguments.Error("Malformed templatetag-tag argument.", nil) } - return ttNode, nil + return tt_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_widthratio.go b/vendor/github.com/flosch/pongo2/tags_widthratio.go index 70c9c3e..d7d7141 100644 --- a/vendor/github.com/flosch/pongo2/tags_widthratio.go +++ b/vendor/github.com/flosch/pongo2/tags_widthratio.go @@ -1,6 +1,7 @@ package pongo2 import ( + "bytes" "fmt" "math" ) @@ -9,10 +10,10 @@ type tagWidthratioNode struct { position *Token current, max IEvaluator width IEvaluator - ctxName string + ctx_name string } -func (node *tagWidthratioNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagWidthratioNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { current, err := node.current.Evaluate(ctx) if err != nil { return err @@ -30,17 +31,17 @@ func (node *tagWidthratioNode) Execute(ctx *ExecutionContext, writer TemplateWri value := int(math.Ceil(current.Float()/max.Float()*width.Float() + 0.5)) - if node.ctxName == "" { - writer.WriteString(fmt.Sprintf("%d", value)) + if node.ctx_name == "" { + buffer.WriteString(fmt.Sprintf("%d", value)) } else { - ctx.Private[node.ctxName] = value + ctx.Private[node.ctx_name] = value } return nil } func tagWidthratioParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - widthratioNode := &tagWidthratioNode{ + widthratio_node := &tagWidthratioNode{ position: start, } @@ -48,34 +49,34 @@ func tagWidthratioParser(doc *Parser, start *Token, arguments *Parser) (INodeTag if err != nil { return nil, err } - widthratioNode.current = current + widthratio_node.current = current max, err := arguments.ParseExpression() if err != nil { return nil, err } - widthratioNode.max = max + widthratio_node.max = max width, err := arguments.ParseExpression() if err != nil { return nil, err } - widthratioNode.width = width + widthratio_node.width = width if arguments.MatchOne(TokenKeyword, "as") != nil { // Name follows - nameToken := arguments.MatchType(TokenIdentifier) - if nameToken == nil { + name_token := arguments.MatchType(TokenIdentifier) + if name_token == nil { return nil, arguments.Error("Expected name (identifier).", nil) } - widthratioNode.ctxName = nameToken.Val + widthratio_node.ctx_name = name_token.Val } if arguments.Remaining() > 0 { return nil, arguments.Error("Malformed widthratio-tag arguments.", nil) } - return widthratioNode, nil + return widthratio_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/tags_with.go b/vendor/github.com/flosch/pongo2/tags_with.go index 32b3c1c..5bf4af0 100644 --- a/vendor/github.com/flosch/pongo2/tags_with.go +++ b/vendor/github.com/flosch/pongo2/tags_with.go @@ -1,16 +1,20 @@ package pongo2 +import ( + "bytes" +) + type tagWithNode struct { - withPairs map[string]IEvaluator - wrapper *NodeWrapper + with_pairs map[string]IEvaluator + wrapper *NodeWrapper } -func (node *tagWithNode) Execute(ctx *ExecutionContext, writer TemplateWriter) *Error { +func (node *tagWithNode) Execute(ctx *ExecutionContext, buffer *bytes.Buffer) *Error { //new context for block withctx := NewChildExecutionContext(ctx) // Put all custom with-pairs into the context - for key, value := range node.withPairs { + for key, value := range node.with_pairs { val, err := value.Evaluate(ctx) if err != nil { return err @@ -18,12 +22,12 @@ func (node *tagWithNode) Execute(ctx *ExecutionContext, writer TemplateWriter) * withctx.Private[key] = val } - return node.wrapper.Execute(withctx, writer) + return node.wrapper.Execute(withctx, buffer) } func tagWithParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Error) { - withNode := &tagWithNode{ - withPairs: make(map[string]IEvaluator), + with_node := &tagWithNode{ + with_pairs: make(map[string]IEvaluator), } if arguments.Count() == 0 { @@ -34,7 +38,7 @@ func tagWithParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Err if err != nil { return nil, err } - withNode.wrapper = wrapper + with_node.wrapper = wrapper if endargs.Count() > 0 { return nil, endargs.Error("Arguments not allowed here.", nil) @@ -42,45 +46,45 @@ func tagWithParser(doc *Parser, start *Token, arguments *Parser) (INodeTag, *Err // Scan through all arguments to see which style the user uses (old or new style). // If we find any "as" keyword we will enforce old style; otherwise we will use new style. - oldStyle := false // by default we're using the new_style + old_style := false // by default we're using the new_style for i := 0; i < arguments.Count(); i++ { if arguments.PeekN(i, TokenKeyword, "as") != nil { - oldStyle = true + old_style = true break } } for arguments.Remaining() > 0 { - if oldStyle { - valueExpr, err := arguments.ParseExpression() + if old_style { + value_expr, err := arguments.ParseExpression() if err != nil { return nil, err } if arguments.Match(TokenKeyword, "as") == nil { return nil, arguments.Error("Expected 'as' keyword.", nil) } - keyToken := arguments.MatchType(TokenIdentifier) - if keyToken == nil { + key_token := arguments.MatchType(TokenIdentifier) + if key_token == nil { return nil, arguments.Error("Expected an identifier", nil) } - withNode.withPairs[keyToken.Val] = valueExpr + with_node.with_pairs[key_token.Val] = value_expr } else { - keyToken := arguments.MatchType(TokenIdentifier) - if keyToken == nil { + key_token := arguments.MatchType(TokenIdentifier) + if key_token == nil { return nil, arguments.Error("Expected an identifier", nil) } if arguments.Match(TokenSymbol, "=") == nil { return nil, arguments.Error("Expected '='.", nil) } - valueExpr, err := arguments.ParseExpression() + value_expr, err := arguments.ParseExpression() if err != nil { return nil, err } - withNode.withPairs[keyToken.Val] = valueExpr + with_node.with_pairs[key_token.Val] = value_expr } } - return withNode, nil + return with_node, nil } func init() { diff --git a/vendor/github.com/flosch/pongo2/template.go b/vendor/github.com/flosch/pongo2/template.go index 869adce..c7fe98b 100644 --- a/vendor/github.com/flosch/pongo2/template.go +++ b/vendor/github.com/flosch/pongo2/template.go @@ -2,72 +2,52 @@ package pongo2 import ( "bytes" + "fmt" "io" - - "github.com/juju/errors" ) -type TemplateWriter interface { - io.Writer - WriteString(string) (int, error) -} - -type templateWriter struct { - w io.Writer -} - -func (tw *templateWriter) WriteString(s string) (int, error) { - return tw.w.Write([]byte(s)) -} - -func (tw *templateWriter) Write(b []byte) (int, error) { - return tw.w.Write(b) -} - type Template struct { set *TemplateSet // Input - isTplString bool - name string - tpl string - size int + is_tpl_string bool + name string + tpl string + size int // Calculation tokens []*Token parser *Parser // first come, first serve (it's important to not override existing entries in here) - level int - parent *Template - child *Template - blocks map[string]*NodeWrapper - exportedMacros map[string]*tagMacroNode + level int + parent *Template + child *Template + blocks map[string]*NodeWrapper + exported_macros map[string]*tagMacroNode // Output root *nodeDocument } -func newTemplateString(set *TemplateSet, tpl []byte) (*Template, error) { +func newTemplateString(set *TemplateSet, tpl string) (*Template, error) { return newTemplate(set, "From: {{ comment.Author.Name }} ({{ comment.Author.Validated|yesno:"validated,not validated,unknown validation status" }})
- - {% if complex.is_admin(comment.Author) %} -This user is an admin (verify: {{ comment.Author.Is_admin }})!
- {% else %} -This user is not admin!
- {% endif %} - -Written {{ comment.Date }}
-{{ comment.Text|striptags }}
- {% endfor %} - - - \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/complex.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/complex.tpl.out deleted file mode 100644 index 7fa3e1d..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/complex.tpl.out +++ /dev/null @@ -1,50 +0,0 @@ - - - - - -Welcome to my new blog page. I'm using pongo2 which supports {{ variables }} and {% tags %}.
-From: user1 (validated)
- - -This user is not admin!
- - -Written 2014-06-10 15:30:15 +0000 UTC
-"pongo2 is nice!"
- -From: user2 (validated)
- - -This user is an admin (verify: True)!
- - -Written 2011-03-21 08:37:56.000000012 +0000 UTC
-comment2 with unsafe tags in it
- -From: user3 (not validated)
- - -This user is not admin!
- - -Written 2014-06-10 15:30:15 +0000 UTC
-hello! there
- - - - \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/cycle.tpl b/vendor/github.com/flosch/pongo2/template_tests/cycle.tpl deleted file mode 100644 index 967d82f..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/cycle.tpl +++ /dev/null @@ -1,22 +0,0 @@ -{% for item in simple.multiple_item_list %} - '{% cycle "item1" simple.name simple.number %}' -{% endfor %} -{% for item in simple.multiple_item_list %} - '{% cycle "item1" simple.name simple.number as cycleitem %}' - May I present the cycle item again: '{{ cycleitem }}' -{% endfor %} -{% for item in simple.multiple_item_list %} - '{% cycle "item1" simple.name simple.number as cycleitem silent %}' - May I present the cycle item: '{{ cycleitem }}' -{% endfor %} -{% for item in simple.multiple_item_list %} - '{% cycle "item1" simple.name simple.number as cycleitem silent %}' - May I present the cycle item: '{{ cycleitem }}' - {% include "inheritance/cycle_include.tpl" %} -{% endfor %} -'{% cycle "item1" simple.name simple.number as cycleitem %}' -'{% cycle cycleitem %}' -'{% cycle "item1" simple.name simple.number as cycleitem silent %}' -'{{ cycleitem }}' -'{% cycle cycleitem %}' -'{{ cycleitem }}' \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/cycle.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/cycle.tpl.out deleted file mode 100644 index b966fb3..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/cycle.tpl.out +++ /dev/null @@ -1,130 +0,0 @@ - - 'item1' - - 'john doe' - - '42' - - 'item1' - - 'john doe' - - '42' - - 'item1' - - 'john doe' - - '42' - - 'item1' - - - 'item1' - May I present the cycle item again: 'item1' - - 'john doe' - May I present the cycle item again: 'john doe' - - '42' - May I present the cycle item again: '42' - - 'item1' - May I present the cycle item again: 'item1' - - 'john doe' - May I present the cycle item again: 'john doe' - - '42' - May I present the cycle item again: '42' - - 'item1' - May I present the cycle item again: 'item1' - - 'john doe' - May I present the cycle item again: 'john doe' - - '42' - May I present the cycle item again: '42' - - 'item1' - May I present the cycle item again: 'item1' - - - '' - May I present the cycle item: 'item1' - - '' - May I present the cycle item: 'john doe' - - '' - May I present the cycle item: '42' - - '' - May I present the cycle item: 'item1' - - '' - May I present the cycle item: 'john doe' - - '' - May I present the cycle item: '42' - - '' - May I present the cycle item: 'item1' - - '' - May I present the cycle item: 'john doe' - - '' - May I present the cycle item: '42' - - '' - May I present the cycle item: 'item1' - - - '' - May I present the cycle item: 'item1' - Included 'item1'. - - '' - May I present the cycle item: 'john doe' - Included 'john doe'. - - '' - May I present the cycle item: '42' - Included '42'. - - '' - May I present the cycle item: 'item1' - Included 'item1'. - - '' - May I present the cycle item: 'john doe' - Included 'john doe'. - - '' - May I present the cycle item: '42' - Included '42'. - - '' - May I present the cycle item: 'item1' - Included 'item1'. - - '' - May I present the cycle item: 'john doe' - Included 'john doe'. - - '' - May I present the cycle item: '42' - Included '42'. - - '' - May I present the cycle item: 'item1' - Included 'item1'. - -'item1' -'john doe' -'' -'item1' -'' -'john doe' \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/empty.tpl b/vendor/github.com/flosch/pongo2/template_tests/empty.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/github.com/flosch/pongo2/template_tests/empty.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/empty.tpl.out deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/github.com/flosch/pongo2/template_tests/expressions.tpl b/vendor/github.com/flosch/pongo2/template_tests/expressions.tpl deleted file mode 100644 index caada14..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/expressions.tpl +++ /dev/null @@ -1,69 +0,0 @@ -integers and complex expressions -{{ 10-100 }} -{{ -(10-100) }} -{{ -(-(10-100)) }} -{{ -1 * (-(-(10-100))) }} -{{ -1 * (-(-(10-100)) ^ 2) ^ 3 + 3 * (5 - 17) + 1 + 2 }} - -floats -{{ 5.5 }} -{{ 5.172841 }} -{{ 5.5 - 1.5 == 4 }} -{{ 5.5 - 1.5 == 4.0 }} - -mul/div -{{ 2 * 5 }} -{{ 2 * 5.0 }} -{{ 2 * 0 }} -{{ 2.5 * 5.3 }} -{{ 1/2 }} -{{ 1/2.0 }} -{{ 1/0.000001 }} - -logic expressions -{{ !true }} -{{ !(true || false) }} -{{ true || false }} -{{ true or false }} -{{ false or false }} -{{ false || false }} -{{ true && (true && (true && (true && (1 == 1 || false)))) }} - -float comparison -{{ 5.5 <= 5.5 }} -{{ 5.5 < 5.5 }} -{{ 5.5 > 5.5 }} -{{ 5.5 >= 5.5 }} - -remainders -{{ (simple.number+7)%7 }} -{{ (simple.number+7)%7 == 0 }} -{{ (simple.number+7)%6 }} - -in/not in -{{ 5 in simple.intmap }} -{{ 2 in simple.intmap }} -{{ 7 in simple.intmap }} -{{ !(5 in simple.intmap) }} -{{ not(7 in simple.intmap) }} -{{ 1 in simple.multiple_item_list }} -{{ 4 in simple.multiple_item_list }} -{{ !(4 in simple.multiple_item_list) }} -{{ "Hello" in simple.misc_list }} -{{ "Hello2" in simple.misc_list }} -{{ 99 in simple.misc_list }} -{{ False in simple.misc_list }} - -issue #48 (associativity for infix operators) -{{ 34/3*3 }} -{{ 10 + 24 / 6 / 2 }} -{{ 6 - 4 - 2 }} - -issue #64 (uint comparison with int const) -{{ simple.uint }} -{{ simple.uint == 8 }} -{{ simple.uint == 9 }} -{{ simple.uint >= 8 }} -{{ simple.uint <= 8 }} -{{ simple.uint < 8 }} -{{ simple.uint > 8 }} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/expressions.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/expressions.tpl.out deleted file mode 100644 index d710fc8..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/expressions.tpl.out +++ /dev/null @@ -1,69 +0,0 @@ -integers and complex expressions --90 -90 --90 -90 -531440999967.000000 - -floats -5.500000 -5.172841 -False -True - -mul/div -10 -10.000000 -0 -13.250000 -0 -0.500000 -1000000.000000 - -logic expressions -False -False -True -True -False -False -True - -float comparison -True -False -False -True - -remainders -0 -True -1 - -in/not in -True -True -False -False -True -True -False -True -True -False -True -False - -issue #48 (associativity for infix operators) -33 -12 -0 - -issue #64 (uint comparison with int const) -8 -True -False -True -True -False -False \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/extends.tpl b/vendor/github.com/flosch/pongo2/template_tests/extends.tpl deleted file mode 100644 index 7216d05..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/extends.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "inheritance/base.tpl" %} - -{% block content %}Extends' content{% endblock %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/extends.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/extends.tpl.out deleted file mode 100644 index 4c535c7..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/extends.tpl.out +++ /dev/null @@ -1 +0,0 @@ -Start#This is base's bodyExtends' content#End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/extends_super.tpl b/vendor/github.com/flosch/pongo2/template_tests/extends_super.tpl deleted file mode 100644 index 54154bd..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/extends_super.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "inheritance/base.tpl" %} - -{% block content %}{{ block.Super }}extends-level-1{% endblock %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/extends_super.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/extends_super.tpl.out deleted file mode 100644 index 7b4e8d2..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/extends_super.tpl.out +++ /dev/null @@ -1 +0,0 @@ -Start#This is base's bodyDefault contentextends-level-1#End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/extends_super2.tpl b/vendor/github.com/flosch/pongo2/template_tests/extends_super2.tpl deleted file mode 100644 index ebac477..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/extends_super2.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "extends_super.tpl" %} - -{% block content %}{{ block.Super }}extends-level-2{% endblock %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/extends_super2.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/extends_super2.tpl.out deleted file mode 100644 index 2284485..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/extends_super2.tpl.out +++ /dev/null @@ -1 +0,0 @@ -Start#This is base's bodyDefault contentextends-level-1extends-level-2#End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/filters-compilation.err b/vendor/github.com/flosch/pongo2/template_tests/filters-compilation.err deleted file mode 100644 index cc5c8cb..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/filters-compilation.err +++ /dev/null @@ -1,5 +0,0 @@ -{{ }} -{{ (1 - 1 }} -{{ 1|float: }} -{{ "test"|non_existent_filter }} -{{ "test"|"test" }} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/filters-compilation.err.out b/vendor/github.com/flosch/pongo2/template_tests/filters-compilation.err.out deleted file mode 100644 index 3562fae..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/filters-compilation.err.out +++ /dev/null @@ -1,5 +0,0 @@ -.*Expected either a number, string, keyword or identifier\. -.*Closing bracket expected after expression -.*Filter parameter required after ':'.* -.*Filter 'non_existent_filter' does not exist\. -.*Filter name must be an identifier\. \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/filters-execution.err b/vendor/github.com/flosch/pongo2/template_tests/filters-execution.err deleted file mode 100644 index 1fc53f2..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/filters-execution.err +++ /dev/null @@ -1,4 +0,0 @@ -{{ -(true || false) }} -{{ simple.func_add("test", 5) }} -{% for item in simple.multiple_item_list %} {{ simple.func_add("test", 5) }} {% endfor %} -{{ simple.func_variadic_sum_int("foo") }} diff --git a/vendor/github.com/flosch/pongo2/template_tests/filters-execution.err.out b/vendor/github.com/flosch/pongo2/template_tests/filters-execution.err.out deleted file mode 100644 index a960607..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/filters-execution.err.out +++ /dev/null @@ -1,4 +0,0 @@ -.*where: execution.*Negative sign on a non\-number expression -.*Function input argument 0 of 'simple.func_add' must be of type int or \*pongo2.Value \(not string\). -.*Function input argument 0 of 'simple.func_add' must be of type int or \*pongo2.Value \(not string\). -.*Function variadic input argument of 'simple.func_variadic_sum_int' must be of type int or \*pongo2.Value \(not string\). diff --git a/vendor/github.com/flosch/pongo2/template_tests/filters.tpl b/vendor/github.com/flosch/pongo2/template_tests/filters.tpl deleted file mode 100644 index 9cace95..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/filters.tpl +++ /dev/null @@ -1,307 +0,0 @@ -add -{{ 5|add:2 }} -{{ 5|add:simple.number }} -{{ 5|add:nothing }} -{{ 5|add:"test" }} -{{ "hello "|add:"john doe" }} -{{ "hello "|add:simple.name }} - -addslashes -{{ "plain text"|addslashes|safe }} -{{ simple.escape_text|addslashes|safe }} - -capfirst -{{ ""|capfirst }} -{{ 5|capfirst }} -{{ "h"|capfirst }} -{{ "hello there!"|capfirst }} -{{ simple.chinese_hello_world|capfirst }} - -cut -{{ 15|cut:"5" }} -{{ "Hello world"|cut: " " }} - -default -{{ simple.nothing|default:"n/a" }} -{{ nothing|default:simple.number }} -{{ simple.number|default:"n/a" }} -{{ 5|default:"n/a" }} - -default_if_none -{{ simple.nothing|default_if_none:"n/a" }} -{{ ""|default_if_none:"n/a" }} -{{ nil|default_if_none:"n/a" }} - -get_digit -{{ 1234567890|get_digit:0 }} -{{ 1234567890|get_digit }} -{{ 1234567890|get_digit:2 }} -{{ 1234567890|get_digit:"4" }} -{{ 1234567890|get_digit:10 }} -{{ 1234567890|get_digit:15 }} - -safe -{{ "" %} -{% firstof doesnotexist ""|safe %} -{% firstof doesnotexist simple.uint 42 %} -{% firstof doesnotexist "test" simple.number 42 %} -{% firstof %} -{% firstof "test" "test2" %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/firstof.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/firstof.tpl.out deleted file mode 100644 index 5ae55ad..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/firstof.tpl.out +++ /dev/null @@ -1,7 +0,0 @@ -42 -<script>alert('xss');</script> - -8 -test - -test \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/for.tpl b/vendor/github.com/flosch/pongo2/template_tests/for.tpl deleted file mode 100644 index d14e632..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/for.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{% for comment in complex.comments %}[{{ forloop.Counter }} {{ forloop.Counter0 }} {{ forloop.First }} {{ forloop.Last }} {{ forloop.Revcounter }} {{ forloop.Revcounter0 }}] {{ comment.Author.Name }} - -{# nested loop #} -{% for char in comment.Text %}{{forloop.Parentloop.Counter0}}.{{forloop.Counter0}}:{{ char|safe }} {% endfor %} - -{% endfor %} - -reversed -'{% for item in simple.multiple_item_list reversed %}{{ item }} {% endfor %}' - -sorted string map -'{% for key in simple.strmap sorted %}{{ key }} {% endfor %}' - -sorted int map -'{% for key in simple.intmap sorted %}{{ key }} {% endfor %}' - -sorted int list -'{% for key in simple.unsorted_int_list sorted %}{{ key }} {% endfor %}' - -reversed sorted int list -'{% for key in simple.unsorted_int_list reversed sorted %}{{ key }} {% endfor %}' - -reversed sorted string map -'{% for key in simple.strmap reversed sorted %}{{ key }} {% endfor %}' - -reversed sorted int map -'{% for key in simple.intmap reversed sorted %}{{ key }} {% endfor %}' diff --git a/vendor/github.com/flosch/pongo2/template_tests/for.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/for.tpl.out deleted file mode 100644 index 27c7120..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/for.tpl.out +++ /dev/null @@ -1,37 +0,0 @@ -[1 0 True False 3 2] user1 - - -0.0:" 0.1:p 0.2:o 0.3:n 0.4:g 0.5:o 0.6:2 0.7: 0.8:i 0.9:s 0.10: 0.11:n 0.12:i 0.13:c 0.14:e 0.15:! 0.16:" - -[2 1 False False 2 1] user2 - - -1.0:c 1.1:o 1.2:m 1.3:m 1.4:e 1.5:n 1.6:t 1.7:2 1.8: 1.9:w 1.10:i 1.11:t 1.12:h 1.13: 1.14:< 1.15:s 1.16:c 1.17:r 1.18:i 1.19:p 1.20:t 1.21:> 1.22:u 1.23:n 1.24:s 1.25:a 1.26:f 1.27:e 1.28:< 1.29:/ 1.30:s 1.31:c 1.32:r 1.33:i 1.34:p 1.35:t 1.36:> 1.37: 1.38:t 1.39:a 1.40:g 1.41:s 1.42: 1.43:i 1.44:n 1.45: 1.46:i 1.47:t - -[3 2 False True 1 0] user3 - - -2.0:< 2.1:b 2.2:> 2.3:h 2.4:e 2.5:l 2.6:l 2.7:o 2.8:! 2.9:< 2.10:/ 2.11:b 2.12:> 2.13: 2.14:t 2.15:h 2.16:e 2.17:r 2.18:e - - - -reversed -'55 34 21 13 8 5 3 2 1 1 ' - -sorted string map -'aab abc bcd gh ukq zab ' - -sorted int map -'1 2 5 ' - -sorted int list -'1 22 192 249 581 8271 9999 1828591 ' - -reversed sorted int list -'1828591 9999 8271 581 249 192 22 1 ' - -reversed sorted string map -'zab ukq gh bcd abc aab ' - -reversed sorted int map -'5 2 1 ' diff --git a/vendor/github.com/flosch/pongo2/template_tests/function_calls_wrapper.tpl b/vendor/github.com/flosch/pongo2/template_tests/function_calls_wrapper.tpl deleted file mode 100644 index 85b870a..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/function_calls_wrapper.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{{ simple.func_add(simple.func_add(5, 15), simple.number) + 17 }} -{{ simple.func_add_iface(simple.func_add_iface(5, 15), simple.number) + 17 }} -{{ simple.func_variadic("hello") }} -{{ simple.func_variadic("hello, %s", simple.name) }} -{{ simple.func_variadic("%d + %d %s %d", 5, simple.number, "is", 49) }} -{{ simple.func_variadic_sum_int() }} -{{ simple.func_variadic_sum_int(1) }} -{{ simple.func_variadic_sum_int(1, 19, 185) }} -{{ simple.func_variadic_sum_int2() }} -{{ simple.func_variadic_sum_int2(2) }} -{{ simple.func_variadic_sum_int2(1, 7, 100) }} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/function_calls_wrapper.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/function_calls_wrapper.tpl.out deleted file mode 100644 index 924e466..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/function_calls_wrapper.tpl.out +++ /dev/null @@ -1,11 +0,0 @@ -79 -79 -hello -hello, john doe -5 + 42 is 49 -0 -1 -205 -0 -2 -108 \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/if.tpl b/vendor/github.com/flosch/pongo2/template_tests/if.tpl deleted file mode 100644 index 29fe936..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/if.tpl +++ /dev/null @@ -1,18 +0,0 @@ -{% if nothing %}false{% else %}true{% endif %} -{% if simple %}simple != nil{% endif %} -{% if simple.uint %}uint != 0{% endif %} -{% if simple.float %}float != 0.0{% endif %} -{% if !simple %}false{% else %}!simple{% endif %} -{% if !simple.uint %}false{% else %}!simple.uint{% endif %} -{% if !simple.float %}false{% else %}!simple.float{% endif %} -{% if "Text" in complex.post %}text field in complex.post{% endif %} -{% if 5 in simple.intmap %}5 in simple.intmap{% endif %} -{% if !0.0 %}!0.0{% endif %} -{% if !0 %}!0{% endif %} -{% if not complex.post %}true{% else %}false{% endif %} -{% if simple.number == 43 %}no{% else %}42{% endif %} -{% if simple.number < 42 %}false{% elif simple.number > 42 %}no{% elif simple.number >= 42 %}yes{% else %}no{% endif %} -{% if simple.number < 42 %}false{% elif simple.number > 42 %}no{% elif simple.number != 42 %}no{% else %}yes{% endif %} -{% if 0 %}!0{% elif nothing %}nothing{% else %}true{% endif %} -{% if 0 %}!0{% elif simple.float %}simple.float{% else %}false{% endif %} -{% if 0 %}!0{% elif !simple.float %}false{% elif "Text" in complex.post%}Elseif with no else{% endif %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/if.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/if.tpl.out deleted file mode 100644 index d4733ec..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/if.tpl.out +++ /dev/null @@ -1,18 +0,0 @@ -true -simple != nil -uint != 0 -float != 0.0 -!simple -!simple.uint -!simple.float -text field in complex.post -5 in simple.intmap -!0.0 -!0 -false -42 -yes -yes -true -simple.float -Elseif with no else \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/ifchanged.tpl b/vendor/github.com/flosch/pongo2/template_tests/ifchanged.tpl deleted file mode 100644 index 0282925..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/ifchanged.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{% for comment in complex.comments2 %} - {% ifchanged %}New comment from another user {{ comment.Author.Name }}{% endifchanged %} - {% ifchanged comment.Author.Validated %} - Validated changed to {{ comment.Author.Validated }} - {% else %} - Validated value not changed - {% endifchanged %} - {% ifchanged comment.Author.Name comment.Date %}Comment's author name or date changed{% endifchanged %} -{% endfor %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/ifchanged.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/ifchanged.tpl.out deleted file mode 100644 index 3f186cb..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/ifchanged.tpl.out +++ /dev/null @@ -1,18 +0,0 @@ - - New comment from another user user1 - - Validated changed to True - - Comment's author name or date changed - - - - Validated value not changed - - Comment's author name or date changed - - New comment from another user user3 - - Validated changed to False - - Comment's author name or date changed diff --git a/vendor/github.com/flosch/pongo2/template_tests/includes.helper b/vendor/github.com/flosch/pongo2/template_tests/includes.helper deleted file mode 100644 index b66db23..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/includes.helper +++ /dev/null @@ -1 +0,0 @@ -I'm {{ what_am_i }}{{ number }} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/includes.tpl b/vendor/github.com/flosch/pongo2/template_tests/includes.tpl deleted file mode 100644 index 2394ee9..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/includes.tpl +++ /dev/null @@ -1,7 +0,0 @@ -Start '{% include "includes.helper" %}' End -Start '{% include "includes.helper" if_exists %}' End -Start '{% include "includes.helper" with what_am_i=simple.name only %}' End -Start '{% include "includes.helper" with what_am_i=simple.name %}' End -Start '{% include simple.included_file|lower with number=7 what_am_i="guest" %}' End -Start '{% include "includes.helper.not_exists" if_exists %}' End -Start '{% include simple.included_file_not_exists if_exists with number=7 what_am_i="guest" %}' End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/includes.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/includes.tpl.out deleted file mode 100644 index 61d9318..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/includes.tpl.out +++ /dev/null @@ -1,7 +0,0 @@ -Start 'I'm 11' End -Start 'I'm 11' End -Start 'I'm john doe' End -Start 'I'm john doe11' End -Start 'I'm guest7' End -Start '' End -Start '' End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/inheritance/base.tpl b/vendor/github.com/flosch/pongo2/template_tests/inheritance/base.tpl deleted file mode 100644 index 2b06d32..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/inheritance/base.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "inheritance2/skeleton.tpl" %} - -{% block body %}This is base's body{% block content %}Default content{% endblock %}{% endblock %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/inheritance/base2.tpl b/vendor/github.com/flosch/pongo2/template_tests/inheritance/base2.tpl deleted file mode 100644 index 5ebad5f..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/inheritance/base2.tpl +++ /dev/null @@ -1 +0,0 @@ -{% include "doesnotexist.tpl" %} diff --git a/vendor/github.com/flosch/pongo2/template_tests/inheritance/cycle_include.tpl b/vendor/github.com/flosch/pongo2/template_tests/inheritance/cycle_include.tpl deleted file mode 100644 index 4b5d7b9..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/inheritance/cycle_include.tpl +++ /dev/null @@ -1 +0,0 @@ -Included '{{ cycleitem }}'. \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/inheritance/inheritance2/skeleton.tpl b/vendor/github.com/flosch/pongo2/template_tests/inheritance/inheritance2/skeleton.tpl deleted file mode 100644 index c07cde6..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/inheritance/inheritance2/skeleton.tpl +++ /dev/null @@ -1 +0,0 @@ -Start#{% block body %}Default body{% endblock %}#End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/issues.tpl b/vendor/github.com/flosch/pongo2/template_tests/issues.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/github.com/flosch/pongo2/template_tests/issues.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/issues.tpl.out deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/github.com/flosch/pongo2/template_tests/lorem.tpl b/vendor/github.com/flosch/pongo2/template_tests/lorem.tpl deleted file mode 100644 index f6b52dd..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/lorem.tpl +++ /dev/null @@ -1,9 +0,0 @@ ------ -{% lorem %} ------ -{% lorem 10 %} ------ -{% lorem 3 p %} ------ -{% lorem 100 w %} ------ \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/lorem.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/lorem.tpl.out deleted file mode 100644 index 286a148..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/lorem.tpl.out +++ /dev/null @@ -1,20 +0,0 @@ ------ -Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ------ -Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. -Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. -Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. -Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis. -At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. -Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. -Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. -Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. ------ -Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
-Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
------ -Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum ------ \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro-compilation.err b/vendor/github.com/flosch/pongo2/template_tests/macro-compilation.err deleted file mode 100644 index baf3e6e..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro-compilation.err +++ /dev/null @@ -1 +0,0 @@ -{% macro test_override() export %}{% endmacro %}{% macro test_override() export %}{% endmacro %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro-compilation.err.out b/vendor/github.com/flosch/pongo2/template_tests/macro-compilation.err.out deleted file mode 100644 index 0c46fba..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro-compilation.err.out +++ /dev/null @@ -1 +0,0 @@ -.*another macro with name 'test_override' already exported \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro-execution.err b/vendor/github.com/flosch/pongo2/template_tests/macro-execution.err deleted file mode 100644 index ef7872c..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro-execution.err +++ /dev/null @@ -1 +0,0 @@ -{% macro number() export %}No number here.{% endmacro %}{{ number() }} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro-execution.err.out b/vendor/github.com/flosch/pongo2/template_tests/macro-execution.err.out deleted file mode 100644 index 32cf3fb..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro-execution.err.out +++ /dev/null @@ -1 +0,0 @@ -.*context key name 'number' clashes with macro 'number' \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro.helper b/vendor/github.com/flosch/pongo2/template_tests/macro.helper deleted file mode 100644 index d9809fd..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro.helper +++ /dev/null @@ -1,2 +0,0 @@ -{% macro imported_macro(foo) export %}Hey {{ foo }}!
{% endmacro %} -{% macro imported_macro_void() export %}Hello mate!
{% endmacro %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro.tpl b/vendor/github.com/flosch/pongo2/template_tests/macro.tpl deleted file mode 100644 index 3c4d931..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro.tpl +++ /dev/null @@ -1,30 +0,0 @@ -Begin -{% macro greetings(to, from=simple.name, name2="guest") %} -Greetings to {{ to }} from {{ from }}. Howdy, {% if name2 == "guest" %}anonymous guest{% else %}{{ name2 }}{% endif %}! -{% endmacro %} -{{ greetings() }} -{{ greetings(10) }} -{{ greetings("john") }} -{{ greetings("john", "michelle") }} -{{ greetings("john", "michelle", "johann") }} -{{ greetings("john", "michelle", "johann", "foobar") }} - -{% macro test2(loop, value) %}map[{{ loop.Counter0 }}] = {{ value }}{% endmacro %} -{% for item in simple.misc_list %} -{{ test2(forloop, item) }}{% endfor %} - -issue #39 (deactivate auto-escape of macros) -{% macro html_test(name) %} -Hello {{ name }}.
-{% endmacro %} -{{ html_test("Max") }} - -Importing macros -{% import "macro.helper" imported_macro, imported_macro as renamed_macro, imported_macro as html_test %} -{{ imported_macro("User1") }} -{{ renamed_macro("User2") }} -{{ html_test("Max") }} - -Chaining macros{% import "macro2.helper" greeter_macro %} -{{ greeter_macro() }} -End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/macro.tpl.out deleted file mode 100644 index 1bb9274..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro.tpl.out +++ /dev/null @@ -1,44 +0,0 @@ -Begin - - -Greetings to from john doe. Howdy, anonymous guest! - - -Greetings to 10 from john doe. Howdy, anonymous guest! - - -Greetings to john from john doe. Howdy, anonymous guest! - - -Greetings to john from michelle. Howdy, anonymous guest! - - -Greetings to john from michelle. Howdy, johann! - -[Error (where: execution) in template_tests/macro.tpl | Line 2 Col 4 near 'macro'] Macro 'greetings' called with too many arguments (4 instead of 3). - - - -map[0] = Hello -map[1] = 99 -map[2] = 3.140000 -map[3] = good - -issue #39 (deactivate auto-escape of macros) - - -Hello Max.
- - -Importing macros - -Hey User1!
-Hey User2!
-Hey Max!
- -Chaining macros - - -One greeting:Hey Dirk!
-Hello mate!
- -End \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/macro2.helper b/vendor/github.com/flosch/pongo2/template_tests/macro2.helper deleted file mode 100644 index faa89c3..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/macro2.helper +++ /dev/null @@ -1,4 +0,0 @@ -{% macro greeter_macro() export %} -{% import "macro.helper" imported_macro, imported_macro_void %} -One greeting: {{ imported_macro("Dirk") }} - {{ imported_macro_void() }} -{% endmacro %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/now.tpl b/vendor/github.com/flosch/pongo2/template_tests/now.tpl deleted file mode 100644 index 99ddae8..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/now.tpl +++ /dev/null @@ -1,2 +0,0 @@ -{# The 'fake' argument exists to have tests for the now-tag; it will set the time to a specific date instead of now #} -{% now "Mon Jan 2 15:04:05 -0700 MST 2006" fake %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/now.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/now.tpl.out deleted file mode 100644 index 4a8a624..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/now.tpl.out +++ /dev/null @@ -1,2 +0,0 @@ - -Wed Feb 5 18:31:45 +0000 UTC 2014 \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/pongo2ctx.tpl b/vendor/github.com/flosch/pongo2/template_tests/pongo2ctx.tpl deleted file mode 100644 index a3715f7..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/pongo2ctx.tpl +++ /dev/null @@ -1 +0,0 @@ -{{ pongo2.version }} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/pongo2ctx.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/pongo2ctx.tpl.out deleted file mode 100644 index 9001211..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/pongo2ctx.tpl.out +++ /dev/null @@ -1 +0,0 @@ -dev \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/quotes.tpl b/vendor/github.com/flosch/pongo2/template_tests/quotes.tpl deleted file mode 100644 index cb89310..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/quotes.tpl +++ /dev/null @@ -1,15 +0,0 @@ -Variables -{{ "hello" }} -{{ 'hello' }} -{{ "hell'o" }} - -Filters -{{ 'Test'|slice:'1:3' }} -{{ 'This is a long test which will be cutted after some chars.
This
is a long test which will be cutted after some chars.'|truncatechars_html:25 }} - -Tags -{% if 'Text' in complex.post %}text field in complex.post{% endif %} - -Functions -{{ simple.func_variadic('hello') }} diff --git a/vendor/github.com/flosch/pongo2/template_tests/quotes.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/quotes.tpl.out deleted file mode 100644 index 4245893..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/quotes.tpl.out +++ /dev/null @@ -1,15 +0,0 @@ -Variables -hello -hello -hell'o - -Filters -es -This is a long test wh...
This
is a long test wh... - -Tags -text field in complex.post - -Functions -hello diff --git a/vendor/github.com/flosch/pongo2/template_tests/sandbox-compilation.err b/vendor/github.com/flosch/pongo2/template_tests/sandbox-compilation.err deleted file mode 100644 index fd59c3b..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/sandbox-compilation.err +++ /dev/null @@ -1,3 +0,0 @@ -{{ "hello"|banned_filter }} -{% banned_tag %} -{% include "../../test_not_existent" %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/sandbox-compilation.err.out b/vendor/github.com/flosch/pongo2/template_tests/sandbox-compilation.err.out deleted file mode 100644 index cbc56ef..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/sandbox-compilation.err.out +++ /dev/null @@ -1,3 +0,0 @@ -.*Usage of filter 'banned_filter' is not allowed \(sandbox restriction active\). -.*Usage of tag 'banned_tag' is not allowed \(sandbox restriction active\). -\[Error \(where: fromfile\) | Line 1 Col 12 near '../../test_not_existent'\] open : no such file or directory \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/sandbox.tpl b/vendor/github.com/flosch/pongo2/template_tests/sandbox.tpl deleted file mode 100644 index 5a58c75..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/sandbox.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{{ "hello"|unbanned_filter }} -{% unbanned_tag %} -{% include temp_file %} \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/sandbox.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/sandbox.tpl.out deleted file mode 100644 index a60ed32..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/sandbox.tpl.out +++ /dev/null @@ -1,3 +0,0 @@ -hello -hello -Hello from pongo2 \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/set.tpl b/vendor/github.com/flosch/pongo2/template_tests/set.tpl deleted file mode 100644 index 3ace3be..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/set.tpl +++ /dev/null @@ -1,6 +0,0 @@ -{% set new_var = "hello" %}{{ new_var }} -{% block content %}{% set new_var = "world" %}{{ new_var }}{% endblock %} -{{ new_var }}{% for item in simple.misc_list %} -{% set new_var = item %}{{ new_var }}{% endfor %} -{{ new_var }} -{% set car=someUndefinedVar %}{{ car.Drive }}No Panic \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/set.tpl.out b/vendor/github.com/flosch/pongo2/template_tests/set.tpl.out deleted file mode 100644 index 9d8d348..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/set.tpl.out +++ /dev/null @@ -1,9 +0,0 @@ -hello -world -world -Hello -99 -3.140000 -good -world -No Panic \ No newline at end of file diff --git a/vendor/github.com/flosch/pongo2/template_tests/spaceless.tpl b/vendor/github.com/flosch/pongo2/template_tests/spaceless.tpl deleted file mode 100644 index 5659e81..0000000 --- a/vendor/github.com/flosch/pongo2/template_tests/spaceless.tpl +++ /dev/null @@ -1,18 +0,0 @@ -{% spaceless %} -- This is a test! Mail me at - - - mail@example.tld - -
- -- - Yep! - -
- -- This is a test! Mail me at - - - mail@example.tld -
- - Yep! - -