MCPcopy Index your code
hub / github.com/coder/coder / ChatParam

Function ChatParam

coderd/httpmw/chatparam.go:15–21  ·  view source on GitHub ↗

ChatParam returns the chat from the ExtractChatParam handler.

(r *http.Request)

Source from the content-addressed store, hash-verified

13
14// ChatParam returns the chat from the ExtractChatParam handler.
15func ChatParam(r *http.Request) database.Chat {
16 chat, ok := r.Context().Value(chatParamContextKey{}).(database.Chat)
17 if !ok {
18 panic("developer error: chat param middleware not provided")
19 }
20 return chat
21}
22
23// ExtractChatParam grabs a chat from the "chat" URL parameter.
24func ExtractChatParam(db database.Store) func(http.Handler) http.Handler {

Callers 15

getChatACLMethod · 0.92
patchChatACLMethod · 0.92
getChatMethod · 0.92
getChatMessagesMethod · 0.92
getChatUserPromptsMethod · 0.92
watchChatGitMethod · 0.92
watchChatDesktopMethod · 0.92
patchChatMethod · 0.92
postChatMessagesMethod · 0.92
patchChatMessageMethod · 0.92

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by 1

TestChatParamFunction · 0.74