Documentation ¶
Index ¶
- type ChangelogProductParameter
- type Configuration
- type ConfigurationRepository
- func (R *ConfigurationRepository) AppendParameter(configuration *Configuration, name, parameterType, comparerType string) (*Configuration, error)
- func (R *ConfigurationRepository) Create(version uint) (*Configuration, error)
- func (R *ConfigurationRepository) Delete(id uint) error
- func (R *ConfigurationRepository) GetAll() ([]Configuration, error)
- func (R *ConfigurationRepository) GetById(id uint) (*Configuration, error)
- func (R *ConfigurationRepository) GetByVersion(version uint) (*Configuration, error)
- func (R *ConfigurationRepository) GetNextVersion() uint
- func (R *ConfigurationRepository) UpdateStatus(configuration *Configuration) (*Configuration, error)
- type Migrator
- type Parameter
- type ParameterRepository
- type ParameterValue
- type Product
- type ProductRepository
- func (P *ProductRepository) Delete(id uint) error
- func (P *ProductRepository) GetByConfiguration(configurationId uint) ([]Product, error)
- func (P *ProductRepository) GetByConfigurationExceptProduct(configurationId uint, productId uint) ([]Product, error)
- func (P *ProductRepository) GetOne(id uint) (Product, error)
- func (P *ProductRepository) GetProductIdsByConfiguration(configurationId uint) ([]uint, error)
- func (P *ProductRepository) InsertOne(configurationId uint, name string, parameterValuesMap map[uint]string, ...)
- func (P *ProductRepository) Update(product Product) error
- type TestConfiguration
- type TestConfigurationRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { gorm.Model Version uint `gorm:"unique autoIncrement"` Active bool `gorm:"default: false"` Valid bool `gorm:"default: false"` Parameters []Parameter `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Products []Product `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` }
type ConfigurationRepository ¶
type ConfigurationRepository struct {
// contains filtered or unexported fields
}
func NewConfigurationRepository ¶
func NewConfigurationRepository(database *gorm.DB) *ConfigurationRepository
func (*ConfigurationRepository) AppendParameter ¶
func (R *ConfigurationRepository) AppendParameter(configuration *Configuration, name, parameterType, comparerType string) (*Configuration, error)
func (*ConfigurationRepository) Create ¶
func (R *ConfigurationRepository) Create(version uint) (*Configuration, error)
func (*ConfigurationRepository) Delete ¶
func (R *ConfigurationRepository) Delete(id uint) error
func (*ConfigurationRepository) GetAll ¶
func (R *ConfigurationRepository) GetAll() ([]Configuration, error)
func (*ConfigurationRepository) GetById ¶
func (R *ConfigurationRepository) GetById(id uint) (*Configuration, error)
func (*ConfigurationRepository) GetByVersion ¶
func (R *ConfigurationRepository) GetByVersion(version uint) (*Configuration, error)
func (*ConfigurationRepository) GetNextVersion ¶
func (R *ConfigurationRepository) GetNextVersion() uint
func (*ConfigurationRepository) UpdateStatus ¶
func (R *ConfigurationRepository) UpdateStatus(configuration *Configuration) (*Configuration, error)
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
type Parameter ¶
type Parameter struct { gorm.Model ConfigurationID uint `gorm:"uniqueIndex:,composite:configuration_name"` Name string `gorm:"uniqueIndex:,composite:configuration_name"` Type string `gorm:"not null"` Comparer decision.Compare `gorm:"not null"` ParameterValues []ParameterValue `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` }
type ParameterRepository ¶
type ParameterRepository struct {
// contains filtered or unexported fields
}
func NewParameterRepository ¶
func NewParameterRepository(database *gorm.DB) *ParameterRepository
func (*ParameterRepository) GetParameterByConfigurationId ¶
func (P *ParameterRepository) GetParameterByConfigurationId(id uint) ([]Parameter, error)
type ParameterValue ¶
type Product ¶
type Product struct { gorm.Model ConfigurationID uint `gorm:"uniqueIndex:,composite:configuration_name"` Name string `gorm:"not null;uniqueIndex:,composite:configuration_name"` ParameterValues []ParameterValue `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` Changelog []ChangelogProductParameter `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` TestConfiguration TestConfiguration `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"` }
type ProductRepository ¶
type ProductRepository struct {
// contains filtered or unexported fields
}
func NewProductRepository ¶
func NewProductRepository(database *gorm.DB) *ProductRepository
func (*ProductRepository) Delete ¶
func (P *ProductRepository) Delete(id uint) error
func (*ProductRepository) GetByConfiguration ¶
func (P *ProductRepository) GetByConfiguration(configurationId uint) ([]Product, error)
func (*ProductRepository) GetByConfigurationExceptProduct ¶
func (P *ProductRepository) GetByConfigurationExceptProduct(configurationId uint, productId uint) ([]Product, error)
func (*ProductRepository) GetProductIdsByConfiguration ¶
func (P *ProductRepository) GetProductIdsByConfiguration(configurationId uint) ([]uint, error)
func (*ProductRepository) Update ¶
func (P *ProductRepository) Update(product Product) error
type TestConfiguration ¶
type TestConfigurationRepository ¶
func NewTestConfigurationRepository ¶
func NewTestConfigurationRepository(database *gorm.DB) *TestConfigurationRepository
func (*TestConfigurationRepository) GetByProductIds ¶
func (T *TestConfigurationRepository) GetByProductIds(productIds []uint) []TestConfiguration
func (*TestConfigurationRepository) InsertOne ¶
func (T *TestConfigurationRepository) InsertOne(productId uint, configuration map[string]string) *TestConfiguration
Click to show internal directories.
Click to hide internal directories.