Git Product home page Git Product logo

Comments (9)

alexedwards avatar alexedwards commented on May 27, 2024

I think that having an example of how to use SCS with Echo would be valuable.

I'm not keen on adding an examples folder for two reasons: first it clutters the repository with code that isn't core to the project, and secondly if your using a vendoring tool which supports recursive vendoring (like GVT) it could easily lead to dependencies to be installed which aren't actually used in someone's compiled application (see FiloSottile/gvt#84 for an example).

I think a sensible way to address this is for example code to be published as Gists and linked to from the main README. I've just pushed commit 2b6a87b which adds an examples section and a link to an example.

If you want to add a example of using SCS with Echo, that would be great. I'll update the title of this issue accordingly.

from scs.

jpfluger avatar jpfluger commented on May 27, 2024

Works for me. Thanks!

from scs.

jpfluger avatar jpfluger commented on May 27, 2024

Oh, but sorry.. my middleware depends on Opts() being exposed. Are you okay with merging pull request #33?

from scs.

alexedwards avatar alexedwards commented on May 27, 2024

It looks like Echo now provides it's own official session middleware which works with the Echo Request and Response objects. I think that this would be a better fit for users of Echo instead of trying to shoehorn SCS into their application.

I've updated the README in 4c09049

from scs.

danielbprice avatar danielbprice commented on May 27, 2024

@alexedwards Just to push back lightly-- AFAICT, what echo has done is a thin wrapper for gorilla/sessions.

I compared the pgstore backend available for gorilla/sessions to the one you wrote for scs, and by far, I prefer your approach. The table is simpler, it isn't auto-created, it is properly indexed, and the code is easier to audit and reason about.

So now I'm vexed-- I'd rather use scs, but I don't really want to drop echo, either. @jpfluger is your middleware usable with scs as it now stands?

from scs.

jpfluger avatar jpfluger commented on May 27, 2024

@danielbprice Yes, it should be usable. But it's also 6 commits behind with this repo and different than my local version which I use extensively in my projects. I need to clean that up and might re-fork to save time (you've been warned! :). @alexedwards does a great job maintaining scs so I would prefer to re-integrate with his repo. I'll make time on Sunday to work on this.

from scs.

spazzymoto avatar spazzymoto commented on May 27, 2024

Sorry to raise a dead issue, but i created Echo SCS Session if anyone is interested in using scs with echo

from scs.

alexedwards avatar alexedwards commented on May 27, 2024

@spazzymoto Thanks, I've added a link to echo-scs-session in the SCS README 👍

from scs.

jpfluger avatar jpfluger commented on May 27, 2024

@spazzymoto Very elegant solution using Echo with SCS. Highly recommended for echo users to check-out Echo SCS Session and adapt to suit your own Echo projects. 🥇

from scs.

Related Issues (20)

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.