aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/unknwon
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-11-06 19:41:42 +0100
committerGitHub <noreply@github.com>2020-11-06 13:41:42 -0500
commit30ce3731a17913155436cee323b1e7016ad8eb49 (patch)
treed03230684af7dfcfff7705ac547a35b3089f02fb /vendor/github.com/unknwon
parenteebaa81f43a6fd982dcd96571a020242f0ea3276 (diff)
downloadgitea-30ce3731a17913155436cee323b1e7016ad8eb49.tar.gz
gitea-30ce3731a17913155436cee323b1e7016ad8eb49.zip
Vendor Update Go Libs (#13444)
* denisenkom/go-mssqldb untagged -> v0.9.0 * github.com/editorconfig/editorconfig-core-go v2.3.7 -> v2.3.8 * github.com/go-testfixtures/testfixtures v3.4.0 -> v3.4.1 * github.com/mholt/archiver v3.3.2 -> v3.5.0 * github.com/olivere/elastic v7.0.20 -> v7.0.21 * github.com/urfave/cli v1.22.4 -> v1.22.5 * github.com/xanzy/go-gitlab v0.38.1 -> v0.39.0 * github.com/yuin/goldmark-meta untagged -> v1.0.0 * github.com/ethantkoenig/rupture 0a76f03a811a -> c3b3b810dc77 * github.com/jaytaylor/html2text 8fb95d837f7d -> 3577fbdbcff7 * github.com/kballard/go-shellquote cd60e84ee657 -> 95032a82bc51 * github.com/msteinert/pam 02ccfbfaf0cc -> 913b8f8cdf8b * github.com/unknwon/paginater 7748a72e0141 -> 042474bd0eae * CI.restart() Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'vendor/github.com/unknwon')
-rw-r--r--vendor/github.com/unknwon/paginater/Makefile9
-rw-r--r--vendor/github.com/unknwon/paginater/README.md10
-rw-r--r--vendor/github.com/unknwon/paginater/go.mod5
-rw-r--r--vendor/github.com/unknwon/paginater/go.sum12
-rw-r--r--vendor/github.com/unknwon/paginater/paginater.go7
5 files changed, 38 insertions, 5 deletions
diff --git a/vendor/github.com/unknwon/paginater/Makefile b/vendor/github.com/unknwon/paginater/Makefile
new file mode 100644
index 0000000000..f5f7ee0f65
--- /dev/null
+++ b/vendor/github.com/unknwon/paginater/Makefile
@@ -0,0 +1,9 @@
+.PHONY: build test vet
+
+build: vet
+
+test:
+ go test -v -cover -race
+
+vet:
+ go vet \ No newline at end of file
diff --git a/vendor/github.com/unknwon/paginater/README.md b/vendor/github.com/unknwon/paginater/README.md
index 8e608ed3ea..26ce498ae2 100644
--- a/vendor/github.com/unknwon/paginater/README.md
+++ b/vendor/github.com/unknwon/paginater/README.md
@@ -1,5 +1,9 @@
-Paginater [![Build Status](https://drone.io/github.com/Unknwon/paginater/status.png)](https://drone.io/github.com/Unknwon/paginater/latest) [![](http://gocover.io/_badge/github.com/Unknwon/paginater)](http://gocover.io/github.com/Unknwon/paginater)
-=========
+# Paginater
+
+[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/unknwon/paginater/Go?logo=github&style=for-the-badge)](https://github.com/unknwon/paginater/actions?query=workflow%3AGo)
+[![codecov](https://img.shields.io/codecov/c/github/unknwon/paginater/master?logo=codecov&style=for-the-badge)](https://codecov.io/gh/unknwon/paginater)
+[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/unknwon/paginater?tab=doc)
+[![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/unknwon/paginater)
Package paginater is a helper module for custom pagination calculation.
@@ -21,7 +25,7 @@ func main() {
// - Total number of rows
// - Number of rows in one page
// - Current page number
- // - Number of page links
+ // - Number of page links to be displayed
p := paginater.New(45, 10, 3, 3)
// Then use p as a template object named "Page" in "demo.html"
diff --git a/vendor/github.com/unknwon/paginater/go.mod b/vendor/github.com/unknwon/paginater/go.mod
new file mode 100644
index 0000000000..a2d25fe841
--- /dev/null
+++ b/vendor/github.com/unknwon/paginater/go.mod
@@ -0,0 +1,5 @@
+module github.com/unknwon/paginater
+
+go 1.14
+
+require github.com/smartystreets/goconvey v1.6.4
diff --git a/vendor/github.com/unknwon/paginater/go.sum b/vendor/github.com/unknwon/paginater/go.sum
new file mode 100644
index 0000000000..b5c3db7a44
--- /dev/null
+++ b/vendor/github.com/unknwon/paginater/go.sum
@@ -0,0 +1,12 @@
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
+github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
+github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
+github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
+github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
diff --git a/vendor/github.com/unknwon/paginater/paginater.go b/vendor/github.com/unknwon/paginater/paginater.go
index ca52a39980..a1d3d395de 100644
--- a/vendor/github.com/unknwon/paginater/paginater.go
+++ b/vendor/github.com/unknwon/paginater/paginater.go
@@ -96,6 +96,11 @@ func (p *Paginater) Current() int {
return p.current
}
+// PagingNum returns number of page size.
+func (p *Paginater) PagingNum() int {
+ return p.pagingNum
+}
+
// Page presents a page in the paginater.
type Page struct {
num int
@@ -137,7 +142,6 @@ func (p *Paginater) Pages() []*Page {
}
numPages := p.numPages
- maxIdx := numPages - 1
offsetIdx := 0
hasMoreNext := false
@@ -156,7 +160,6 @@ func (p *Paginater) Pages() []*Page {
offsetVal := p.current - previousNum
if offsetVal > 1 {
numPages++
- maxIdx++
offsetIdx = 1
}