pkg

package
v0.0.0-...-c75624c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseWriterKey = 6
)

ResponseWriterKey From twirp: internal/contextkeys/keys.go

Variables

This section is empty.

Functions

func GetSession

func GetSession(ctx context.Context) session.Store

GetSession gets the session set by go chi session middleware.

func GetUserFromSession

func GetUserFromSession(ctx context.Context) (uint, string, error)

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 NewAdmin

func NewAdmin(db *gorm.DB) ctfg.Admin

func NewAdminHooks

func NewAdminHooks(db *gorm.DB) *twirp.ServerHooks

func NewBackend

func NewBackend(db *gorm.DB) ctfg.Backend

func NewLoggingServerHooks

func NewLoggingServerHooks() *twirp.ServerHooks

func RemoveUserFromSession

func RemoveUserFromSession(ctx context.Context)

func SetUserForSession

func SetUserForSession(ctx context.Context, userID uint, userType string)

SetUserForSession will set the user id in the session store located in the context.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL