(ctx context.Context, activity string)
| 293 | } |
| 294 | |
| 295 | func (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 | |
| 308 | func isUsernameValid(username string) bool { |
| 309 | // assuming valid usernames are alphanumeric, with these special characters allowed: . _ - |
no test coverage detected