Documentation ¶
Index ¶
- func Register() fx.Option
- func ToCreateResponse(response *entity.Tenant) *tenantv1.CreateTenantResponse
- func ToGetResponse(response *entity.Tenant) *tenantv1.GetTenantResponse
- func ToListRequest(_ *tenantv1.ListTenantsRequest) *model2.ListRequest
- func ToListResponse(response *model2.ListResponse[entity.Tenant]) *tenantv1.ListTenantsResponse
- func ToUpdateResponse(response *entity.Tenant) *tenantv1.UpdateTenantResponse
- type CreateTenantRequest
- type GetTenantRequest
- type Port
- func (t Port) CreateTenant(ctx context.Context, request *CreateTenantRequest) (*entity.Tenant, error)
- func (t Port) GetTenant(ctx context.Context, request *GetTenantRequest) (*entity.Tenant, error)
- func (t Port) ListTenants(ctx context.Context, request *domain.ListRequest) (*domain.ListResponse[entity.Tenant], error)
- func (t Port) UpdateTenant(ctx context.Context, request *UpdateTenantRequest) (*entity.Tenant, error)
- type PortParams
- type Service
- type ServiceParams
- type UpdateTenantRequest
- type Validator
- type ValidatorParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToCreateResponse ¶
func ToCreateResponse(response *entity.Tenant) *tenantv1.CreateTenantResponse
func ToGetResponse ¶
func ToGetResponse(response *entity.Tenant) *tenantv1.GetTenantResponse
func ToListRequest ¶
func ToListRequest(_ *tenantv1.ListTenantsRequest) *model2.ListRequest
func ToListResponse ¶
func ToListResponse(response *model2.ListResponse[entity.Tenant]) *tenantv1.ListTenantsResponse
func ToUpdateResponse ¶
func ToUpdateResponse(response *entity.Tenant) *tenantv1.UpdateTenantResponse
Types ¶
type CreateTenantRequest ¶
type CreateTenantRequest struct { Name string `json:"name"` Domain string `json:"port"` Timezone string `json:"timezone"` SubscriptionType int `json:"subscription_type"` SelfRegistrationEnabled bool `json:"self_registration_enabled"` }
func ToCreateRequest ¶
func ToCreateRequest(request *tenantv1.CreateTenantRequest) *CreateTenantRequest
type GetTenantRequest ¶
func ToGetRequest ¶
func ToGetRequest(request *tenantv1.GetTenantRequest) *GetTenantRequest
type Port ¶
type Port struct { DoListTenants endpoint.Endpoint DoGetTenant endpoint.Endpoint DoCreateTenant endpoint.Endpoint DoUpdateTenant endpoint.Endpoint }
func NewPort ¶
func NewPort(params PortParams) Port
func (Port) CreateTenant ¶
func (Port) ListTenants ¶
func (t Port) ListTenants( ctx context.Context, request *domain.ListRequest, ) (*domain.ListResponse[entity.Tenant], error)
func (Port) UpdateTenant ¶
type PortParams ¶
type Service ¶
type Service interface { ListTenants(ctx context.Context, request *domain.ListRequest) (*domain.ListResponse[entity.Tenant], error) GetTenant(ctx context.Context, request *GetTenantRequest) (*entity.Tenant, error) CreateTenant(ctx context.Context, request *CreateTenantRequest) (*entity.Tenant, error) UpdateTenant(ctx context.Context, request *UpdateTenantRequest) (*entity.Tenant, error) }
func NewService ¶
func NewService(params ServiceParams) Service
type ServiceParams ¶
type ServiceParams struct { fx.In Logger *zap.Logger Store repository.TenantRepo `name:"tenant_store"` }
type UpdateTenantRequest ¶
type UpdateTenantRequest struct { ID uuid.UUID `json:"id"` Name string `json:"name"` SubscriptionType int `json:"subscription_type"` SelfRegistrationEnabled bool `json:"self_registration_enabled"` }
func ToUpdateRequest ¶
func ToUpdateRequest(request *tenantv1.UpdateTenantRequest) *UpdateTenantRequest
type Validator ¶
type Validator interface { ValidateCreateTenant(ctx context.Context, request *CreateTenantRequest) error ValidateUpdateTenant(ctx context.Context, request *UpdateTenantRequest) error }
func NewValidator ¶
func NewValidator(params ValidatorParams) Validator
type ValidatorParams ¶
type ValidatorParams struct { fx.In Repo repository.TenantRepo `name:"tenant_store"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.