Documentation ¶
Index ¶
- type SettingsMetaData
- type TenantSettings
- func (tenant *TenantSettings) GetSettings() (map[string]interface{}, error)
- func (tenant *TenantSettings) SetTenantSettingsAndAccess(metadatas []SettingsMetaData, values map[string]interface{}) error
- func (tenant *TenantSettings) Update(configuration map[string]interface{}, metadatas []SettingsMetaData) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SettingsMetaData ¶
type SettingsMetaData struct { Code string `json:"code"` DisplayName string `json:"displayName"` Description string `json:"description"` GroupName string `json:"groupName"` DisplaySequence int `json:"displaySequence"` Type string `json:"type"` TypeParam string `json:"typeParam"` Default string `json:"default"` Required bool `json:"required"` Validation string `json:"validation"` MaxValue float32 `json:"maxValue"` MinValue float32 `json:"minValue"` Hidden bool `json:"hidden"` Access string `json:"access"` DefaultAccess string `json:"defaultAccess"` }
SettingsMetaData contains the metadata regarding settings
func (*SettingsMetaData) ParseAndValidate ¶
func (metadata *SettingsMetaData) ParseAndValidate(value interface{}) (interface{}, error)
ParseAndValidate checks if the supplied value matches the metadata
type TenantSettings ¶
type TenantSettings struct { microappModel.Base Settings string `gorm:"column:settings;type:text;"` }
Tenant supports different organisations from the same micro service.
func NewTenant ¶
func NewTenant(context microappCtx.ExecutionContext, tenantID uuid.UUID, metadata []SettingsMetaData) (*TenantSettings, error)
NewTenant creates new instance of Tenant with specified parameters and returns it
func (*TenantSettings) GetSettings ¶
func (tenant *TenantSettings) GetSettings() (map[string]interface{}, error)
GetSettings gets unmarshalled settings for tenant
func (*TenantSettings) SetTenantSettingsAndAccess ¶
func (tenant *TenantSettings) SetTenantSettingsAndAccess(metadatas []SettingsMetaData, values map[string]interface{}) error
SetTenantSettings updates the tenant settings
func (*TenantSettings) Update ¶
func (tenant *TenantSettings) Update(configuration map[string]interface{}, metadatas []SettingsMetaData) error
Update tenant data
Click to show internal directories.
Click to hide internal directories.