FAQ
Could someone point me to a nice implementation of how CRUD is used in GO?
So far I have found this -
http://paste.ubuntu.com/8503695/
but it is incomplete. I come from Python, so I really need an example of
how CRUD is used in GO.

thanks

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • DV at Apr 20, 2015 at 5:26 pm
    This is a strange question.

    You're looking for an example that demonstrates how to do Create, Update,
    Delete with a relational database in Go? You can start
    here: http://golang.org/pkg/database/sql/
    Or are you looking for an ORM?
    On Monday, April 20, 2015 at 10:22:29 AM UTC-6, mm wrote:

    Could someone point me to a nice implementation of how CRUD is used in GO?
    So far I have found this -
    http://paste.ubuntu.com/8503695/
    but it is incomplete. I come from Python, so I really need an example of
    how CRUD is used in GO.

    thanks
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mm at Apr 20, 2015 at 5:42 pm
    Sorry for being so oblique. Im using mgo/mongodb
    I am trying to understand, specifically how to do GET and POST... usually
    in python I have something like this:

    class Edit(BaseHandler, Jinja2Rendering): @auth_admin def get(self, user_id): """Display a user profile """

    Not sure how to do that in my func(c *context) UserEdit(rw web.ResponseWriter, req *web.Request) {}


    On my list page I have the list of users and when you click on one you get to the user edit page.

    I get from my list page to my edit page like so


    rootRouter.Get("/user/edit/*:user_id*", (*Context).UserEdit)

    In python I get the user_id from params. How does that work in go?




    On Monday, April 20, 2015 at 1:26:52 PM UTC-4, DV wrote:

    This is a strange question.

    You're looking for an example that demonstrates how to do Create, Update,
    Delete with a relational database in Go? You can start here:
    http://golang.org/pkg/database/sql/
    Or are you looking for an ORM?
    On Monday, April 20, 2015 at 10:22:29 AM UTC-6, mm wrote:

    Could someone point me to a nice implementation of how CRUD is used in
    GO? So far I have found this -
    http://paste.ubuntu.com/8503695/
    but it is incomplete. I come from Python, so I really need an example of
    how CRUD is used in GO.

    thanks
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Egon at Apr 20, 2015 at 6:46 pm
    Read http://golang.org/doc/articles/wiki/ it has an example how to use FormValue.
    Then http://astaxie.gitbooks.io/build-web-application-with-golang/content/ for a thorough explanation how to build web apps with Go.

    + Egon

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mm at Apr 20, 2015 at 7:39 pm
    Thanks so much Egon, those are great links for me!!
    On Monday, April 20, 2015 at 2:46:36 PM UTC-4, Egon wrote:

    Read http://golang.org/doc/articles/wiki/ it has an example how to use
    FormValue.
    Then http://astaxie.gitbooks.io/build-web-application-with-golang/content/
    for a thorough explanation how to build web apps with Go.

    + Egon
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mm at Apr 20, 2015 at 7:38 pm
    Ok found what I am looking for...Using Gocraft:

    You can capture path variables like this:

    router.Get("/suggestions/:suggestion_id/comments/:comment_id")

    In your handler, you can access them like this:

    func (c *YourContext) Root(rw web.ResponseWriter, req *web.Request) {
         fmt.Fprint(rw, "Suggestion ID:", req.PathParams["suggestion_id"])
         fmt.Fprint(rw, "Comment ID:", req.PathParams["comment_id"])
    }

    You can also validate the format of your path params with a regexp. For
    instance, to ensure the 'ids' start with a digit:

    router.Get("/suggestions/:suggestion_id:\\d.*/comments/:comment_id:\\d.*")

    On Monday, April 20, 2015 at 12:22:29 PM UTC-4, mm wrote:

    Could someone point me to a nice implementation of how CRUD is used in GO?
    So far I have found this -
    http://paste.ubuntu.com/8503695/
    but it is incomplete. I come from Python, so I really need an example of
    how CRUD is used in GO.

    thanks
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Guillermo Estrada at Apr 20, 2015 at 8:51 pm
    You're probably looking how to do an app using a framework (router at
    least) and a database backend. I read you use MongoDB in Python, so for
    that you should use the excellent Mongo library by Gustavo Niemeyer:

    http://labix.org/mgo

    As for frameworks, depending on the level of the app you want to code there
    are a LOT, if you are only looking for a router and stuff to use with Go's
    standard lib... I can definitely recommend Gorilla Toolkit
    (http://www.gorillatoolkit.org/) you want to be using the MUX package at
    least, it supports everything from subdomains to regular expression routing.

    As for frameworks, Martini, Gin, and Goji are the simplest to get into IMHO.

    https://github.com/go-martini/martini
    https://github.com/gin-gonic/gin
    https://goji.io/

    Most of them have great documentation to get you started, as for
    tutorialesque writing in this matter a simple Google search yields some of
    them (once you know what to look for).

    http://progadventure.blogspot.mx/2014/03/learning-go-with-martini-working-with.html
    http://blog.gopheracademy.com/advent-2013/day-11-martini/

    Hope this helps.


    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mm at Apr 21, 2015 at 12:07 am
    Thank you so much Guillermo, yes I need to keep it light so am just using
    mgo and gocraft. I am really liking Go so far. Its a little complex for me
    but once it compiles I know I have something sure and lightning fast.
    On Monday, April 20, 2015 at 4:51:12 PM UTC-4, Guillermo Estrada wrote:

    You're probably looking how to do an app using a framework (router at
    least) and a database backend. I read you use MongoDB in Python, so for
    that you should use the excellent Mongo library by Gustavo Niemeyer:

    http://labix.org/mgo

    As for frameworks, depending on the level of the app you want to code
    there are a LOT, if you are only looking for a router and stuff to use with
    Go's standard lib... I can definitely recommend Gorilla Toolkit (
    http://www.gorillatoolkit.org/) you want to be using the MUX package at
    least, it supports everything from subdomains to regular expression routing.

    As for frameworks, Martini, Gin, and Goji are the simplest to get into
    IMHO.

    https://github.com/go-martini/martini
    https://github.com/gin-gonic/gin
    https://goji.io/

    Most of them have great documentation to get you started, as for
    tutorialesque writing in this matter a simple Google search yields some of
    them (once you know what to look for).


    http://progadventure.blogspot.mx/2014/03/learning-go-with-martini-working-with.html
    http://blog.gopheracademy.com/advent-2013/day-11-martini/

    Hope this helps.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Egon at Apr 21, 2015 at 8:42 am
    Also forgot... two must videos to watch:
    https://vimeo.com/115940590
    https://www.youtube.com/watch?v=yi5A3cK1LNA

    :)

    + Egon
    On Tuesday, 21 April 2015 03:07:41 UTC+3, mm wrote:

    Thank you so much Guillermo, yes I need to keep it light so am just using
    mgo and gocraft. I am really liking Go so far. Its a little complex for me
    but once it compiles I know I have something sure and lightning fast.
    On Monday, April 20, 2015 at 4:51:12 PM UTC-4, Guillermo Estrada wrote:

    You're probably looking how to do an app using a framework (router at
    least) and a database backend. I read you use MongoDB in Python, so for
    that you should use the excellent Mongo library by Gustavo Niemeyer:

    http://labix.org/mgo

    As for frameworks, depending on the level of the app you want to code
    there are a LOT, if you are only looking for a router and stuff to use with
    Go's standard lib... I can definitely recommend Gorilla Toolkit (
    http://www.gorillatoolkit.org/) you want to be using the MUX package at
    least, it supports everything from subdomains to regular expression routing.

    As for frameworks, Martini, Gin, and Goji are the simplest to get into
    IMHO.

    https://github.com/go-martini/martini
    https://github.com/gin-gonic/gin
    https://goji.io/

    Most of them have great documentation to get you started, as for
    tutorialesque writing in this matter a simple Google search yields some of
    them (once you know what to look for).


    http://progadventure.blogspot.mx/2014/03/learning-go-with-martini-working-with.html
    http://blog.gopheracademy.com/advent-2013/day-11-martini/

    Hope this helps.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mm at Apr 22, 2015 at 8:36 pm
    Thank you Egon! Super helpful links !
    On Tuesday, April 21, 2015 at 4:42:06 AM UTC-4, Egon wrote:

    Also forgot... two must videos to watch:
    https://vimeo.com/115940590
    https://www.youtube.com/watch?v=yi5A3cK1LNA

    :)

    + Egon
    On Tuesday, 21 April 2015 03:07:41 UTC+3, mm wrote:

    Thank you so much Guillermo, yes I need to keep it light so am just
    using mgo and gocraft. I am really liking Go so far. Its a little complex
    for me but once it compiles I know I have something sure and lightning
    fast.
    On Monday, April 20, 2015 at 4:51:12 PM UTC-4, Guillermo Estrada wrote:

    You're probably looking how to do an app using a framework (router at
    least) and a database backend. I read you use MongoDB in Python, so for
    that you should use the excellent Mongo library by Gustavo Niemeyer:

    http://labix.org/mgo

    As for frameworks, depending on the level of the app you want to code
    there are a LOT, if you are only looking for a router and stuff to use with
    Go's standard lib... I can definitely recommend Gorilla Toolkit (
    http://www.gorillatoolkit.org/) you want to be using the MUX package at
    least, it supports everything from subdomains to regular expression routing.

    As for frameworks, Martini, Gin, and Goji are the simplest to get into
    IMHO.

    https://github.com/go-martini/martini
    https://github.com/gin-gonic/gin
    https://goji.io/

    Most of them have great documentation to get you started, as for
    tutorialesque writing in this matter a simple Google search yields some of
    them (once you know what to look for).


    http://progadventure.blogspot.mx/2014/03/learning-go-with-martini-working-with.html
    http://blog.gopheracademy.com/advent-2013/day-11-martini/

    Hope this helps.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 20, '15 at 4:22p
activeApr 22, '15 at 8:36p
posts10
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase