Documentation
¶
Index ¶
- func GetOAuthServerClient(ctx context.Context) *models.OAuthServerClient
- func GetSession(ctx context.Context) *models.Session
- func GetUser(ctx context.Context) *models.User
- func SendJSON(w http.ResponseWriter, status int, obj interface{}) error
- func WithOAuthServerClient(ctx context.Context, client *models.OAuthServerClient) context.Context
- func WithSession(ctx context.Context, s *models.Session) context.Context
- func WithUser(ctx context.Context, u *models.User) context.Context
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOAuthServerClient ¶
func GetOAuthServerClient(ctx context.Context) *models.OAuthServerClient
GetOAuthServerClient retrieves an OAuth server client from the context
func GetSession ¶
GetSession reads the session from the context - shared implementation
func SendJSON ¶
func SendJSON(w http.ResponseWriter, status int, obj interface{}) error
SendJSON sends a JSON response with proper error handling
func WithOAuthServerClient ¶
WithOAuthServerClient adds an OAuth server client to the context
func WithSession ¶
WithSession adds the session to the context - shared implementation
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey is the type for context keys to avoid collisions
const ( UserKey ContextKey = "user" SessionKey ContextKey = "session" OAuthServerClientKey ContextKey = "oauth_server_client" )
Context keys used across packages
func (ContextKey) String ¶
func (c ContextKey) String() string
Click to show internal directories.
Click to hide internal directories.