MCPcopy Index your code
hub / github.com/cli/cli / notifyCodespaceOfClientActivity

Method notifyCodespaceOfClientActivity

internal/codespaces/rpc/invoker.go:295–306  ·  view source on GitHub ↗
(ctx context.Context, activity string)

Source from the content-addressed store, hash-verified

293}
294
295func (i *invoker) notifyCodespaceOfClientActivity(ctx context.Context, activity string) error {
296 ctx = i.appendMetadata(ctx)
297 ctx, cancel := context.WithTimeout(ctx, requestTimeout)
298 defer cancel()
299
300 _, err := i.codespaceClient.NotifyCodespaceOfClientActivity(ctx, &codespace.NotifyCodespaceOfClientActivityRequest{ClientId: clientName, ClientActivities: []string{activity}})
301 if err != nil {
302 return fmt.Errorf("failed to invoke notify RPC: %w", err)
303 }
304
305 return nil
306}
307
308func isUsernameValid(username string) bool {
309 // assuming valid usernames are alphanumeric, with these special characters allowed: . _ -

Callers 2

connectFunction · 0.95
heartbeatMethod · 0.95

Calls 3

appendMetadataMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected