repository

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUniqueId

func GetUniqueId(profileId int, platform string) string

Types

type InfraConfigRepository

type InfraConfigRepository interface {
	GetProfileByName(name string) (*InfraProfileEntity, error)
	GetConfigurationsByProfileName(profileName string) ([]*InfraProfileConfigurationEntity, error)
	GetConfigurationsByProfileIds(profileIds []int) ([]*InfraProfileConfigurationEntity, error)
	GetPlatformsByProfileName(profileName string) ([]*ProfilePlatformMapping, error)

	CreatePlatformProfileMapping(tx *pg.Tx, platformMapping []*ProfilePlatformMapping) error

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

	UpdateConfigurations(tx *pg.Tx, configurations []*InfraProfileConfigurationEntity) error
	UpdateProfile(tx *pg.Tx, profileName string, profile *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 []*InfraProfileConfigurationEntity) error

func (*InfraConfigRepositoryImpl) CreatePlatformProfileMapping

func (impl *InfraConfigRepositoryImpl) CreatePlatformProfileMapping(tx *pg.Tx, platformMapping []*ProfilePlatformMapping) error

func (*InfraConfigRepositoryImpl) CreateProfile

func (impl *InfraConfigRepositoryImpl) CreateProfile(tx *pg.Tx, infraProfile *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) GetConfigurationsByProfileIds

func (impl *InfraConfigRepositoryImpl) GetConfigurationsByProfileIds(profileIds []int) ([]*InfraProfileConfigurationEntity, error)

func (*InfraConfigRepositoryImpl) GetConfigurationsByProfileName

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

func (*InfraConfigRepositoryImpl) GetPlatformsByProfileName

func (impl *InfraConfigRepositoryImpl) GetPlatformsByProfileName(profileName string) ([]*ProfilePlatformMapping, error)

func (*InfraConfigRepositoryImpl) GetProfileByName

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

func (*InfraConfigRepositoryImpl) UpdateBuildxDriverTypeInAllProfiles

func (impl *InfraConfigRepositoryImpl) UpdateBuildxDriverTypeInAllProfiles(tx *pg.Tx, buildxDriverType infraBean.BuildxDriver) error

func (*InfraConfigRepositoryImpl) UpdateConfigurations

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

func (*InfraConfigRepositoryImpl) UpdateProfile

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

type InfraProfileConfigurationEntity

type InfraProfileConfigurationEntity struct {
	Id                       int                 `sql:"id,pk"`
	Key                      infraBean.ConfigKey `sql:"key,notnull"`
	Value                    float64             `sql:"value"`
	ValueString              string              `sql:"value_string,notnull"`
	Unit                     units.UnitSuffix    `sql:"unit,notnull"`
	ProfilePlatformMappingId int                 `sql:"profile_platform_mapping_id"`
	Active                   bool                `sql:"active,notnull"`
	UniqueId                 string              `sql:"-"`
	// Deprecated; use ProfilePlatformMappingId
	ProfileId int `sql:"profile_id"`

	ProfilePlatformMapping *ProfilePlatformMapping
	sql.AuditLog
	// contains filtered or unexported fields
}

type InfraProfileEntity

type InfraProfileEntity struct {
	Id               int                    `sql:"id"`
	Name             string                 `sql:"name"`
	Description      string                 `sql:"description"`
	BuildxDriverType infraBean.BuildxDriver `sql:"buildx_driver_type,notnull"`
	Active           bool                   `sql:"active"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type ProfilePlatformMapping

type ProfilePlatformMapping struct {
	Id        int    `sql:"id"`
	ProfileId int    `sql:"profile_id"`
	Platform  string `sql:"platform"`
	Active    bool   `sql:"active"`
	UniqueId  string `sql:"-"`
	sql.AuditLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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