Create - Create new Tenant
(ctx context.Context, request *v1.TenantCreateRequest)
| 31 | |
| 32 | // Create - Create new Tenant |
| 33 | func (t *TenancyServer) Create(ctx context.Context, request *v1.TenantCreateRequest) (*v1.TenantCreateResponse, error) { |
| 34 | ctx, span := internal.Tracer.Start(ctx, "tenant.create") |
| 35 | defer span.End() |
| 36 | |
| 37 | tenant, err := t.tw.CreateTenant(ctx, request.GetId(), request.GetName()) |
| 38 | if err != nil { |
| 39 | span.RecordError(err) |
| 40 | span.SetStatus(otelCodes.Error, err.Error()) |
| 41 | slog.ErrorContext(ctx, err.Error()) |
| 42 | return nil, status.Error(GetStatus(err), err.Error()) |
| 43 | } |
| 44 | |
| 45 | return &v1.TenantCreateResponse{ |
| 46 | Tenant: tenant, |
| 47 | }, nil |
| 48 | } |
| 49 | |
| 50 | // Delete - Delete a Tenant |
| 51 | func (t *TenancyServer) Delete(ctx context.Context, request *v1.TenantDeleteRequest) (*v1.TenantDeleteResponse, error) { |
nothing calls this directly
no test coverage detected