Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CORSConfig = middleware.CORSWithConfig(middleware.CORSConfig{ AllowOrigins: strings.Split(os.Getenv("ALLOW_ORIGINS"), ","), AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept}, AllowCredentials: true, })
CORSConfig for api services. Can be configured via .env.
Functions ¶
func DeleteSession ¶ added in v0.0.7
func DeleteSession(c echo.Context)
DeleteSession removes session from storage using c.
func GetSession ¶ added in v0.0.7
GetSession selects u from the session storage by using c. In case there is no user contains is set false.
func NewSession ¶ added in v0.0.7
NewSession creates a cookie using the `COOKIE_SECURE` and `SAME_SITE` variables from the os environment. For that use .env file in your project. The cookie is always be httpOnly and have a durancy of 7 days. The `user` will be stored in that session as []byte generated with json.Marshal(user).
func SessionAuth ¶ added in v0.0.7
func SessionAuth(next echo.HandlerFunc) echo.HandlerFunc
SessionAuth go to next if the request has a session else return 401.
func SessionRedisStore ¶ added in v0.0.7
func SessionRedisStore() echo.MiddlewareFunc
SessionRedisStore initial session store via Redis and return session.Middleware. Use with echo framework like echo.Echo.Use(SessionRedisStore())
Types ¶
This section is empty.