refactor: rename internal/session package to internal/ctx

This commit is contained in:
Prad Nukala
2024-10-08 17:22:14 -04:00
parent 35348fef6a
commit 25cddbada6
11 changed files with 10 additions and 12 deletions
@@ -1,4 +1,4 @@
package session
package ctx
import (
"net/http"
@@ -1,10 +1,8 @@
package session
package ctx
import (
"github.com/labstack/echo/v4"
"github.com/segmentio/ksuid"
"github.com/onsonr/sonr/internal/headers"
)
// GetSession returns the current Session
@@ -16,7 +14,7 @@ func GetSession(c echo.Context) *Session {
func UseSession(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
sc := initSession(c)
headers := new(headers.RequestHeaders)
headers := new(RequestHeaders)
err := sc.Bind(headers)
if err != nil {
return err
@@ -1,4 +1,4 @@
package headers
package ctx
type RequestHeaders struct {
CacheControl *string `header:"Cache-Control"`
@@ -1,4 +1,4 @@
package headers
package ctx
type ResponseHeaders struct {
// HTMX Specific