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

Method newStoreChatAttachmentFunc

coderd/x/chatd/store_chat_attachment.go:15–28  ·  view source on GitHub ↗
(workspaceCtx *turnWorkspaceContext)

Source from the content-addressed store, hash-verified

13)
14
15func (p *Server) newStoreChatAttachmentFunc(workspaceCtx *turnWorkspaceContext) chattool.StoreFileFunc {
16 return func(
17 ctx context.Context,
18 name string,
19 detectName string,
20 data []byte,
21 ) (chattool.AttachmentMetadata, error) {
22 workspaceCtx.chatStateMu.Lock()
23 chatSnapshot := *workspaceCtx.currentChat
24 workspaceCtx.chatStateMu.Unlock()
25
26 return p.storeChatAttachment(ctx, chatSnapshot, name, detectName, data)
27 }
28}
29
30func (p *Server) storeChatAttachment(
31 ctx context.Context,

Callers 1

runChatMethod · 0.95

Calls 3

storeChatAttachmentMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected