bean

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationBean

type ConfigurationBean struct {
	ConfigurationBeanAbstract
	Value string `json:"value" validate:"required,gt=0"`
}

type ConfigurationBeanAbstract

type ConfigurationBeanAbstract struct {
	Id          int                `json:"id"`
	Key         util2.ConfigKeyStr `json:"key"`
	Unit        string             `json:"unit" validate:"required,gt=0"`
	ProfileName string             `json:"profileName"`
	ProfileId   int                `json:"profileId"`
	Active      bool               `json:"active"`
}

type ConfigurationBeanV0

type ConfigurationBeanV0 struct {
	ConfigurationBeanAbstract
	Value float64 `json:"value" validate:"required,gt=0"`
}

Deprecated

type InfraConfig

type InfraConfig struct {
	// currently only for ci
	CiLimitCpu       string `env:"LIMIT_CI_CPU" envDefault:"0.5"`
	CiLimitMem       string `env:"LIMIT_CI_MEM" envDefault:"3G"`
	CiReqCpu         string `env:"REQ_CI_CPU" envDefault:"0.5"`
	CiReqMem         string `env:"REQ_CI_MEM" envDefault:"3G"`
	CiDefaultTimeout int64  `env:"DEFAULT_TIMEOUT" envDefault:"3600"`
}

InfraConfig is used for read only purpose outside this package

func (InfraConfig) GetCiDefaultTimeout

func (infraConfig InfraConfig) GetCiDefaultTimeout() int64

func (InfraConfig) GetCiLimitCpu

func (infraConfig InfraConfig) GetCiLimitCpu() string

func (InfraConfig) GetCiLimitMem

func (infraConfig InfraConfig) GetCiLimitMem() string

func (InfraConfig) GetCiReqCpu

func (infraConfig InfraConfig) GetCiReqCpu() string

func (InfraConfig) GetCiReqMem

func (infraConfig InfraConfig) GetCiReqMem() string

func (InfraConfig) LoadCiLimitCpu

func (infraConfig InfraConfig) LoadCiLimitCpu() (*InfraProfileConfigurationEntity, error)

func (InfraConfig) LoadCiLimitMem

func (infraConfig InfraConfig) LoadCiLimitMem() (*InfraProfileConfigurationEntity, error)

func (InfraConfig) LoadCiReqCpu

func (infraConfig InfraConfig) LoadCiReqCpu() (*InfraProfileConfigurationEntity, error)

func (InfraConfig) LoadCiReqMem

func (infraConfig InfraConfig) LoadCiReqMem() (*InfraProfileConfigurationEntity, error)

func (InfraConfig) LoadDefaultTimeout

func (infraConfig InfraConfig) LoadDefaultTimeout() (*InfraProfileConfigurationEntity, error)

func (InfraConfig) LoadInfraConfigInEntities

func (infraConfig InfraConfig) LoadInfraConfigInEntities() ([]*InfraProfileConfigurationEntity, error)

func (*InfraConfig) SetCiDefaultTimeout

func (infraConfig *InfraConfig) SetCiDefaultTimeout(timeout int64)

func (*InfraConfig) SetCiLimitCpu

func (infraConfig *InfraConfig) SetCiLimitCpu(cpu string)

func (*InfraConfig) SetCiLimitMem

func (infraConfig *InfraConfig) SetCiLimitMem(mem string)

func (*InfraConfig) SetCiReqCpu

func (infraConfig *InfraConfig) SetCiReqCpu(cpu string)

func (*InfraConfig) SetCiReqMem

func (infraConfig *InfraConfig) SetCiReqMem(mem string)

type InfraConfigMetaData

type InfraConfigMetaData struct {
	DefaultConfigurations map[string][]*ConfigurationBean              `json:"defaultConfigurations"`
	ConfigurationUnits    map[util2.ConfigKeyStr]map[string]units.Unit `json:"configurationUnits"`
}

type InfraConfigMetaDataV0

type InfraConfigMetaDataV0 struct {
	DefaultConfigurations []ConfigurationBeanV0                        `json:"defaultConfigurations"`
	ConfigurationUnits    map[util2.ConfigKeyStr]map[string]units.Unit `json:"configurationUnits"`
}

Deprecated

type InfraProfileConfigurationEntity

type InfraProfileConfigurationEntity struct {
	Id          int              `sql:"id"`
	Key         util2.ConfigKey  `sql:"key"`
	Value       float64          `sql:"value"`
	ValueString string           `sql:"value_string"`
	Unit        units.UnitSuffix `sql:"unit"`
	ProfileId   int              `sql:"profile_id"`
	Platform    string           `sql:"platform"`
	Active      bool             `sql:"active"`
	sql.AuditLog
	// contains filtered or unexported fields
}

type InfraProfileEntity

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

func (*InfraProfileEntity) ConvertToProfileBean

func (infraProfile *InfraProfileEntity) ConvertToProfileBean() ProfileBean

type ProfileBean

type ProfileBean struct {
	ProfileBeanAbstract
	Configurations map[string][]*ConfigurationBean `json:"configurations" validate:"dive"`
}

func (*ProfileBean) ConvertToInfraProfileEntity

func (profileBean *ProfileBean) ConvertToInfraProfileEntity() *InfraProfileEntity

type ProfileBeanAbstract

type ProfileBeanAbstract struct {
	Id          int               `json:"id"`
	Name        string            `json:"name" validate:"required,min=1,max=50"`
	Description string            `json:"description" validate:"max=300"`
	Active      bool              `json:"active"`
	Type        util2.ProfileType `json:"type"`
	AppCount    int               `json:"appCount"`
	CreatedBy   int32             `json:"createdBy"`
	CreatedOn   time.Time         `json:"createdOn"`
	UpdatedBy   int32             `json:"updatedBy"`
	UpdatedOn   time.Time         `json:"updatedOn"`
}

type ProfileBeanV0

type ProfileBeanV0 struct {
	ProfileBeanAbstract
	Configurations []ConfigurationBeanV0 `json:"configurations" validate:"dive"`
}

Deprecated

type ProfileResponse

type ProfileResponse struct {
	Profile ProfileBean `json:"profile"`
	InfraConfigMetaData
}

type ProfileResponseV0

type ProfileResponseV0 struct {
	Profile ProfileBeanV0 `json:"profile"`
	InfraConfigMetaDataV0
}

Deprecated

type Scope

type Scope struct {
	AppId int
}

Jump to

Keyboard shortcuts

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