Giter Site home page Giter Site logo

go-pg / urlstruct Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 2.0 97 KB

urlstruct decodes url.Values into structs

Home Page: https://godoc.org/github.com/go-pg/urlstruct

License: BSD 2-Clause "Simplified" License

Go 99.36% Makefile 0.64%
go go-pg golang postgresql

urlstruct's People

Contributors

dovbysh avatar renovate-bot avatar vmihailenco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

dovbysh baajarmeh

urlstruct's Issues

Unknown revision v0.5.1

Hi,
I use github.com/go-pg/urlstruct v1.0.0 in go.mod, but I have in go.sum:

github.com/go-pg/urlstruct v0.1.0/go.mod h1:2Nag+BIny6G/KYCkdt++ZnqU/VinzimGapKfs4kwlN0=
github.com/go-pg/urlstruct v0.2.6/go.mod h1:dxENwVISWSOX+k87hDt0ueEJadD+gZWv3tHzwfmZPu8=
github.com/go-pg/urlstruct v0.3.0/go.mod h1:/XKyiUOUUS3onjF+LJxbfmSywYAdl6qMfVbX33Q8rgg=
github.com/go-pg/urlstruct v0.4.0/go.mod h1:/XKyiUOUUS3onjF+LJxbfmSywYAdl6qMfVbX33Q8rgg=
github.com/go-pg/urlstruct v0.5.1/go.mod h1:VbjqQPvrKLolA2KROt9eUEOeYuu2mylco3uknDx05v8=
github.com/go-pg/urlstruct v1.0.0 h1:i6yB2e6m1+DtqlG9tOF9jA8+41ATdS9LUBcCNJCXVfE=
github.com/go-pg/urlstruct v1.0.0/go.mod h1:+vNFqd9u0YX0RqGCTA11SC+wRHM28EpwJpa/EwyHR+o=

And I see issue: go: github.com/go-pg/[email protected]: unknown revision v0.5.1
Please help me!!!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

gomod
go.mod
  • go 1.13
  • github.com/codemodus/kace v0.5.1
  • github.com/google/uuid v1.1.4
  • github.com/onsi/ginkgo v1.14.1
  • github.com/onsi/gomega v1.10.2
  • github.com/vmihailenco/tagparser v0.1.2

  • Check this box to trigger a request for Renovate to run again on this repository

Max Pages

Hi, currently using:

		postFilter := new(urlstruct.Pager)
		err := urlstruct.Decode(postFilter, c.Request.URL.Query())
		postFilter.MaxLimit = PostsPerPage

		maxPages := 1

		// fetch blog posts
		var posts []models.BlogPost
		totalCount, err := c.GetDatabase().Model(&posts).
			Limit(postFilter.GetLimit()).
			Offset(postFilter.GetOffset()).
			Order("blp_created DESC").SelectAndCount()

		if err != nil && err != pg.ErrNoRows {
			log.Printf("could not fetch blog posts: %v", err)
		} else {
			maxPages = roundUp(float64(totalCount) / PostsPerPage)
		}

		// set template data
		_, sessErr := c.GetSessionEngine().GetSession(c)
		tmplData := system.GetTemplateData(c, gin.H{
			"LoggedIn": sessErr == nil,
			"Posts":    posts,
			"Page":     postFilter.GetPage(),
			"MaxPage":  maxPages,
		})

Is there a way to fetch the maximum amount of pages?
Or does this library only construct the limit and offset?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.