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