infraConfig

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InfraConfigRepository

type InfraConfigRepository interface {
	GetProfileByName(name string) (*bean.InfraProfileEntity, error)
	GetConfigurationsByProfileName(profileName string) ([]*bean.InfraProfileConfigurationEntity, error)
	GetConfigurationsByProfileId(profileId int) ([]*bean.InfraProfileConfigurationEntity, error)

	CreateProfile(tx *pg.Tx, infraProfile *bean.InfraProfileEntity) error
	CreateConfigurations(tx *pg.Tx, configurations []*bean.InfraProfileConfigurationEntity) error

	UpdateConfigurations(tx *pg.Tx, configurations []*bean.InfraProfileConfigurationEntity) error
	UpdateProfile(tx *pg.Tx, profileName string, profile *bean.InfraProfileEntity) error
	sql.TransactionWrapper
}

type InfraConfigRepositoryImpl

type InfraConfigRepositoryImpl struct {
	*sql.TransactionUtilImpl
	// contains filtered or unexported fields
}

func NewInfraProfileRepositoryImpl

func NewInfraProfileRepositoryImpl(dbConnection *pg.DB, TransactionUtilImpl *sql.TransactionUtilImpl) *InfraConfigRepositoryImpl

func (*InfraConfigRepositoryImpl) CreateConfigurations

func (impl *InfraConfigRepositoryImpl) CreateConfigurations(tx *pg.Tx, configurations []*bean.InfraProfileConfigurationEntity) error

func (*InfraConfigRepositoryImpl) CreateProfile

func (impl *InfraConfigRepositoryImpl) CreateProfile(tx *pg.Tx, infraProfile *bean.InfraProfileEntity) error

CreateProfile saves the default profile in the database only once in a lifetime. If the default profile already exists, it will not be saved again.

func (*InfraConfigRepositoryImpl) GetConfigurationsByProfileId

func (impl *InfraConfigRepositoryImpl) GetConfigurationsByProfileId(profileId int) ([]*bean.InfraProfileConfigurationEntity, error)

func (*InfraConfigRepositoryImpl) GetConfigurationsByProfileName

func (impl *InfraConfigRepositoryImpl) GetConfigurationsByProfileName(profileName string) ([]*bean.InfraProfileConfigurationEntity, error)

func (*InfraConfigRepositoryImpl) GetProfileByName

func (impl *InfraConfigRepositoryImpl) GetProfileByName(name string) (*bean.InfraProfileEntity, error)

func (*InfraConfigRepositoryImpl) UpdateConfigurations

func (impl *InfraConfigRepositoryImpl) UpdateConfigurations(tx *pg.Tx, configurations []*bean.InfraProfileConfigurationEntity) error

func (*InfraConfigRepositoryImpl) UpdateProfile

func (impl *InfraConfigRepositoryImpl) UpdateProfile(tx *pg.Tx, profileName string, profile *bean.InfraProfileEntity) error

type InfraConfigService

type InfraConfigService interface {

	// GetConfigurationUnits fetches all the units for the configurations.
	GetConfigurationUnits() map[util2.ConfigKeyStr]map[string]units.Unit
	// GetProfileByName fetches the profile and its configurations matching the given profileName.
	GetProfileByName(name string) (*bean.ProfileBean, error)
	// UpdateProfile updates the profile and its configurations matching the given profileName.
	// If profileName is empty, it will return an error.
	UpdateProfile(userId int32, profileName string, profileBean *bean.ProfileBean) error

	GetInfraConfigurationsByScopeAndPlatform(scope bean.Scope, platform string) (*bean.InfraConfig, error)
}

type InfraConfigServiceImpl

type InfraConfigServiceImpl struct {
	// contains filtered or unexported fields
}

func NewInfraConfigServiceImpl

func NewInfraConfigServiceImpl(logger *zap.SugaredLogger,
	infraProfileRepo InfraConfigRepository,
	appService app.AppService,
	units *units.Units) (*InfraConfigServiceImpl, error)

func (*InfraConfigServiceImpl) GetConfigurationUnits

func (impl *InfraConfigServiceImpl) GetConfigurationUnits() map[util2.ConfigKeyStr]map[string]units.Unit

func (*InfraConfigServiceImpl) GetInfraConfigurationsByScopeAndPlatform added in v1.1.0

func (impl *InfraConfigServiceImpl) GetInfraConfigurationsByScopeAndPlatform(scope bean.Scope, platform string) (*bean.InfraConfig, error)

func (*InfraConfigServiceImpl) GetProfileByName

func (impl *InfraConfigServiceImpl) GetProfileByName(name string) (*bean.ProfileBean, error)

func (*InfraConfigServiceImpl) UpdateProfile

func (impl *InfraConfigServiceImpl) UpdateProfile(userId int32, profileName string, profileToUpdate *bean.ProfileBean) error

func (*InfraConfigServiceImpl) Validate

func (impl *InfraConfigServiceImpl) Validate(profileToUpdate *bean.ProfileBean, defaultProfile *bean.ProfileBean) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL