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
    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
    Geofrey Ernest
    @gernest
    @Slacki sorry to hear that
    I will look into this tomorrow
    It is past midnight here.
    Kacper Czochara
    @Slacki
    yeah, it's one hour earlier here ;)
    Geofrey Ernest
    @gernest
    @Slacki I am looking on the middleware issue now, hope I will fix it by tonight
    Geofrey Ernest
    @gernest
    @Slacki I just fixed #50 try to check it out
    enjoy :smile:
    Kacper Czochara
    @Slacki
    @gernest thank you very much. gonna check this out leter as i am late to the party already. ;) have a nice weekend!
    Geofrey Ernest
    @gernest
    @Slacki are you there?
    Kacper Czochara
    @Slacki
    @gernest yeah, what's up