MCPcopy
hub / github.com/docker/docker-agent / now

Method now

pkg/session/session.go:1003–1008  ·  view source on GitHub ↗

now returns the session's current time, falling back to time.Now for sessions created without a clock (e.g. JSON deserialization).

()

Source from the content-addressed store, hash-verified

1001// now returns the session's current time, falling back to time.Now for
1002// sessions created without a clock (e.g. JSON deserialization).
1003func (s *Session) now() time.Time {
1004 if s.clock != nil {
1005 return s.clock()
1006 }
1007 return time.Now()
1008}
1009
1010// newID returns a fresh session ID using the session's generator, falling back
1011// to a random UUID for sessions created without one.

Callers 15

NewFunction · 0.95
CompactionInputMethod · 0.95
UpdateToolResultMethod · 0.80
UpdateMethod · 0.80
UpdateMethod · 0.80
GetMethod · 0.80
PutMethod · 0.80
expiredMethod · 0.80
WithUserMessageFunction · 0.80
WithImplicitUserMessageFunction · 0.80
WithSystemMessageFunction · 0.80

Implementers 7

fakeSessionpkg/tools/lifecycle/supervisor_test.go
sessionClientpkg/tools/mcp/session_client.go
mockMCPClientpkg/tools/mcp/mcp_test.go
reconnectableMockClientpkg/tools/mcp/mcp_test.go
failingInitClientpkg/tools/mcp/reconnect_test.go
clientSessionpkg/tools/mcp/mcp.go
lspSessionpkg/tools/builtin/lsp/lsp_lifecycle.go

Calls 1

NowMethod · 0.80