StoreLicense will store license into file.
(ctx context.Context, workspaceID string, license string)
| 386 | |
| 387 | // StoreLicense will store license into file. |
| 388 | func (s *LicenseService) StoreLicense(ctx context.Context, workspaceID string, license string) error { |
| 389 | if license != "" { |
| 390 | if _, err := s.parseLicense(license, workspaceID); err != nil { |
| 391 | return err |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | if err := s.store.UpdateLicense(ctx, workspaceID, license); err != nil { |
| 396 | return err |
| 397 | } |
| 398 | |
| 399 | // Invalidate cache |
| 400 | s.cache.Remove(licenseCacheKey(workspaceID)) |
| 401 | |
| 402 | return nil |
| 403 | } |
| 404 | |
| 405 | // LicenseParams contains the business fields for license generation. |
| 406 | type LicenseParams struct { |
no test coverage detected