Documentation ¶
Index ¶
- Constants
- func GetSession(ctx context.Context) session.Store
- func GetUserFromSession(ctx context.Context) (uint, string, error)
- func NewAPIHandler(assets fs.FS, twirpHandler ctfg.TwirpServer, adminHandler ctfg.TwirpServer) http.Handler
- func NewAdmin(db *gorm.DB) ctfg.Admin
- func NewAdminHooks(db *gorm.DB) *twirp.ServerHooks
- func NewBackend(db *gorm.DB) ctfg.Backend
- func NewLoggingServerHooks() *twirp.ServerHooks
- func RemoveUserFromSession(ctx context.Context)
- func SetUserForSession(ctx context.Context, userID uint, userType string)
Constants ¶
View Source
const (
ResponseWriterKey = 6
)
ResponseWriterKey From twirp: internal/contextkeys/keys.go
Variables ¶
This section is empty.
Functions ¶
func GetSession ¶
GetSession gets the session set by go chi session middleware.
func GetUserFromSession ¶
GetUserFromSession will get the user id from the session store located in the context.
func NewAPIHandler ¶
func NewAPIHandler(assets fs.FS, twirpHandler ctfg.TwirpServer, adminHandler ctfg.TwirpServer) http.Handler
func NewAdminHooks ¶
func NewAdminHooks(db *gorm.DB) *twirp.ServerHooks
func NewLoggingServerHooks ¶
func NewLoggingServerHooks() *twirp.ServerHooks
func RemoveUserFromSession ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.