Documentation
¶
Index ¶
- type TenantListParamParser
- type TenantService
- func (svc TenantService) Create(ctx context.Context, tenantSpec TenantSpec) (*TenantSpec, error)
- func (svc TenantService) DeleteByTenantId(ctx context.Context, tenantId string) error
- func (svc TenantService) GetByTenantId(ctx context.Context, tenantId string) (*TenantSpec, error)
- func (svc TenantService) List(ctx context.Context, listParams service.ListParams) ([]TenantSpec, error)
- func (svc TenantService) Routes() ([]service.Route, error)
- func (svc TenantService) UpdateByTenantId(ctx context.Context, tenantId string, tenantSpec UpdateTenantSpec) (*TenantSpec, error)
- type TenantSpec
- type UpdateTenantSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TenantListParamParser ¶
type TenantListParamParser struct{}
func (TenantListParamParser) GetDefaultSortBy ¶
func (parser TenantListParamParser) GetDefaultSortBy() string
func (TenantListParamParser) GetSupportedSortBys ¶
func (parser TenantListParamParser) GetSupportedSortBys() []string
func (TenantListParamParser) ParseValue ¶
func (parser TenantListParamParser) ParseValue(val string, sortBy string) (interface{}, error)
type TenantService ¶
type TenantService struct {
service.BaseService
// contains filtered or unexported fields
}
func NewService ¶
func NewService(env service.Env, objectSvc object.Service) *TenantService
func (TenantService) Create ¶
func (svc TenantService) Create(ctx context.Context, tenantSpec TenantSpec) (*TenantSpec, error)
func (TenantService) DeleteByTenantId ¶
func (svc TenantService) DeleteByTenantId(ctx context.Context, tenantId string) error
func (TenantService) GetByTenantId ¶
func (svc TenantService) GetByTenantId(ctx context.Context, tenantId string) (*TenantSpec, error)
func (TenantService) List ¶
func (svc TenantService) List(ctx context.Context, listParams service.ListParams) ([]TenantSpec, error)
func (TenantService) UpdateByTenantId ¶
func (svc TenantService) UpdateByTenantId(ctx context.Context, tenantId string, tenantSpec UpdateTenantSpec) (*TenantSpec, error)
type TenantSpec ¶
type TenantSpec struct {
TenantId string `json:"tenantId" validate:"omitempty,valid_object_id"`
Name *string `json:"name"`
CreatedAt time.Time `json:"createdAt"`
}
func NewTenantSpecFromObjectSpec ¶
func NewTenantSpecFromObjectSpec(objectSpec *object.ObjectSpec) (*TenantSpec, error)
func (TenantSpec) ToCreateObjectSpec ¶
func (spec TenantSpec) ToCreateObjectSpec() (*object.CreateObjectSpec, error)
type UpdateTenantSpec ¶
type UpdateTenantSpec struct {
Name *string `json:"name"`
}
func (UpdateTenantSpec) ToUpdateObjectSpec ¶
func (updateSpec UpdateTenantSpec) ToUpdateObjectSpec() *object.UpdateObjectSpec
Click to show internal directories.
Click to hide internal directories.