Skip to content

Commit

Permalink
Making connection context key exported
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivanshVij committed Sep 10, 2024
1 parent e4e8578 commit 5672a73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/constants.templ
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{define "constants"}}
const connectionContextKey int = 1000
const ConnectionContextKey int = 1000

func SetErrorFlag(flags uint8, error bool) uint8 {
return flags | 0x2
Expand Down
2 changes: 1 addition & 1 deletion templates/server.templ
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func NewServer({{ GetServerFields .services }}, tlsConfig *tls.Config, logger ty
{{ end -}}

s.server.ConnContext = func (ctx context.Context, conn *frisbee.Async) context.Context {
return context.WithValue(ctx, connectionContextKey, conn)
return context.WithValue(ctx, ConnectionContextKey, conn)
}

return s, nil
Expand Down

0 comments on commit 5672a73

Please sign in to comment.