Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Geofrey Ernest
    @gernest
    The Database connection is already a global like object( only one object passed around)
    And there is already a connection pool taken care for you
    Kacper Czochara
    @Slacki
    I am aware of that
    Geofrey Ernest
    @gernest
    okay
    Kacper Czochara
    @Slacki
    I just find it easy to process some data with goroutine
    Geofrey Ernest
    @gernest
    I see
    Kacper Czochara
    @Slacki
    I think when database connection is open it should be accessible globally
    In PHP I would use some cron tasks to do what I need to do
    but goroutine is just perfect solution
    If I only could access DB there
    Geofrey Ernest
    @gernest
    You know that the database is available in *Context right?
    Kacper Czochara
    @Slacki
    Yes, but I don't know other ways of accessing *Context than in controller method or middleware
    Geofrey Ernest
    @gernest
    So you can pass a middleware that pulls it and assigns to a global variable in your app
    It will be easy that way
    As globals are discouraged in Go
    Kacper Czochara
    @Slacki
    I don't really like this solution, because middleware is fired up on each request
    But I guess that's not big performance impact with this one assign, right?
    Geofrey Ernest
    @gernest
    you can check if it hasnt been assigned yet
    Kacper Czochara
    @Slacki
    Okay, thanks
    btw, what's up with my issue?
    I've tried to solve this
    but failed
    Geofrey Ernest
    @gernest
    I'm at work right now, I cant address the issue yet. Be patiend.
    Kacper Czochara
    @Slacki
    Sure thing.
    Thanks again
    Geofrey Ernest
    @gernest
    You are welcome
    Kacper Czochara
    @Slacki
    @gernest how can I achieve nested templates with utron? For example
    [HEADER HERE]
    some html
    [FOOTER HERE]
    I get no such template error using {{template "header.html"}}
    Kacper Czochara
    @Slacki
    By the way I'm sorry for beeing obtrusive... You're very patient and helpful.
    Geofrey Ernest
    @gernest
    @Slacki its okay, I actually don't mind .
    you just don't need to add the extension. Instead of {{template "header.html"}} try {{template "header"}}
    just make sure in the views directory there is header.html file
    Kacper Czochara
    @Slacki
    Works like a charm. Thanks. How does this happen?
    Geofrey Ernest
    @gernest
    It is a feature, to help easy templating with utron
    Kacper Czochara
    @Slacki
    Sweet.
    Geofrey Ernest
    @gernest
    :smile:
    Geofrey Ernest
    @gernest
    @Slacki wow, just saw the wiki. Awesome work. Thanks.
    Kacper Czochara
    @Slacki
    @gernest i plan to add more content
    sometime soon
    Geofrey Ernest
    @gernest
    that will be great
    I really appreciate your efforts
    @Slacki I want to release a first version of utron
    After polishing edge cases and maybe improve some things. Anything you have to say about this is welcome
    Kacper Czochara
    @Slacki
    those 2 issues that i've opened
    anything else is just perfect
    Geofrey Ernest
    @gernest
    okay
    Kacper Czochara
    @Slacki
    Damn, been fighting with #50 for a while now, but the complexity is hard. Context should be shared somehow bethween the middlewares, then it should be possible to convert them to func (http.Handlaer) http.Handler and yet it should be possible to mix those two types together. God.
    Maybe it would be easier to do some kind of hybrid middleware, like func (http.Handler, *Context) (http.Handler, error). What do you think @gernest