The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
yagamil

gin 有没有类似 flask, django 这种缓存装饰器这样用法的?

  •  
  •   yagamil · Jun 18, 2022 · 2390 views
    This topic created in 1612 days ago, the information mentioned may be changed or developed.

    python 下的 flask django 使用中间件 cache ,可以方便地使用 redis 缓存。 gin 下不知道有没有类似的用法。 没有的话,只能 json 序列化,从 redis 里面取了

    fityme
    fityme
    Jun 18, 2022
    1
    go 的中间件不都是这么实现的。只是没有对应的语法糖而已
    cheng6563
    cheng6563
    Jun 19, 2022
    2
    go 的反射做不带这些东西,类似场景 go 要么硬编码要么代码生成。
    janxin
    janxin
    Jun 19, 2022
    3
    没有语法糖实现装饰器

    如果是缓存返回结果可以使用中间件
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2412 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 257ms · UTC 11:57 · PVG 19:57 · LAX 03:57 · JFK 06:57
    ♥ Do have faith in what you're doing.