Documentation ¶
Index ¶
- type SettingsMetaData
- type TenantSettings
- func (tenant *TenantSettings) GetSettings() (map[string]string, error)
- func (tenant *TenantSettings) GetSettingsMap() (map[string]string, error)
- func (tenant *TenantSettings) GetTenantSettings(metadatas []SettingsMetaData) error
- func (tenant *TenantSettings) SetTenantSettings(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"` }
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]string, error)
GetSettings gets unmarshalled settings for tenant
func (*TenantSettings) GetSettingsMap ¶
func (tenant *TenantSettings) GetSettingsMap() (map[string]string, error)
GetSettingsMap
func (*TenantSettings) GetTenantSettings ¶
func (tenant *TenantSettings) GetTenantSettings(metadatas []SettingsMetaData) error
GetTenantSettings gets the tenant settings with default
func (*TenantSettings) SetTenantSettings ¶
func (tenant *TenantSettings) SetTenantSettings(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.