Documentation
¶
Index ¶
- Constants
- func CreateHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
- func DeleteHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
- func GetHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
- func ListHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
- func UpdateHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
- 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 ¶
View Source
const ResourceTypeTenant = "tenant"
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶
func CreateHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
func DeleteHandler ¶
func DeleteHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
func GetHandler ¶
func GetHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
func ListHandler ¶
func ListHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
func UpdateHandler ¶
func UpdateHandler(svc TenantService, w http.ResponseWriter, r *http.Request) error
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 ¶
func NewService ¶
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) Routes ¶
func (svc TenantService) Routes() ([]service.Route, error)
GetRoutes registers all route handlers for this module
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 NewTenantSpecFromQueryResult ¶ added in v0.51.0
func NewTenantSpecFromQueryResult(queryResult *query.QueryResult) (*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.