bean

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: 2 Imported by: 0

Documentation

Index

Constants

View Source
const BuildxK8sDriverMigrated string = "build-infra-migrated"
View Source
const CPULimReqErrorCompErr = "cpu limit should not be less than cpu request"
View Source
const ConfigurationMissingInGlobalPlatform = "configuration missing in the global Platform"
View Source
const DEFAULT_PROFILE_EXISTS = "default profile exists"
View Source
const DEFAULT_PROFILE_NAME = "default"

TODO Asutosh: Backward compatibility for default profile is compromised. revisit this.

View Source
const GLOBAL_PROFILE_NAME = "global"
View Source
const InvalidProfileName = "profile name is invalid"
View Source
const InvalidTypeValue = "invalid value found in %s with value %s "
View Source
const InvalidUnit = "invalid %s unit found in %s "
View Source
const InvalidValueType = "invalid Value type Found"
View Source
const MEMLimReqErrorCompErr = "memory limit should not be less than memory request"
View Source
const NO_PROPERTIES_FOUND = "no properties found"
View Source
const PayloadValidationError = "payload validation failed"
View Source
const QualifiedDescriptionMaxLength = 350
View Source
const QualifiedPlatformMaxLength = 50
View Source
const QualifiedProfileMaxLength = 253
View Source
const RUNNER_PLATFORM = "runner"

internal-platforms

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildxDriver added in v1.2.1

type BuildxDriver string
const (
	// BuildxK8sDriver is the default driver for buildx
	BuildxK8sDriver BuildxDriver = "kubernetes"
	// BuildxDockerContainerDriver is the driver for docker container
	BuildxDockerContainerDriver BuildxDriver = "docker-container"
)

func (BuildxDriver) IsDockerContainer added in v1.2.1

func (b BuildxDriver) IsDockerContainer() bool

func (BuildxDriver) IsKubernetes added in v1.2.1

func (b BuildxDriver) IsKubernetes() bool

func (BuildxDriver) IsPlatformSupported added in v1.2.1

func (b BuildxDriver) IsPlatformSupported(platform string) bool

func (BuildxDriver) IsValid added in v1.2.1

func (b BuildxDriver) IsValid() bool

func (BuildxDriver) String added in v1.2.1

func (b BuildxDriver) String() string

type ConfigKey added in v1.2.1

type ConfigKey int
const CPULimitKey ConfigKey = 1
const CPURequestKey ConfigKey = 2
const MemoryLimitKey ConfigKey = 3
const MemoryRequestKey ConfigKey = 4
const TimeOutKey ConfigKey = 5

type ConfigKeyStr added in v1.2.1

type ConfigKeyStr string
const CPU_LIMIT ConfigKeyStr = "cpu_limit"
const CPU_REQUEST ConfigKeyStr = "cpu_request"
const MEMORY_LIMIT ConfigKeyStr = "memory_limit"
const MEMORY_REQUEST ConfigKeyStr = "memory_request"
const TIME_OUT ConfigKeyStr = "timeout"

type ConfigurationBean

type ConfigurationBean struct {
	ConfigurationBeanAbstract
	Value interface{} `json:"value"`
}

type ConfigurationBeanAbstract

type ConfigurationBeanAbstract struct {
	Id                       int          `json:"id"`
	Key                      ConfigKeyStr `json:"key"`
	Unit                     string       `json:"unit"`
	ProfilePlatformMappingId int          `json:"profilePlatformMappingId"`
	Active                   bool         `json:"active"`
	ProfileName              string       `json:"profileName"`
	ProfileId                int          `json:"profileId"`
}

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) 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[ConfigKeyStr]map[string]units.Unit `json:"configurationUnits"`
}

type InfraConfigMetaDataV0

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

Deprecated

type ProfileAndConfig added in v1.2.1

type ProfileAndConfig struct {
	GlobalProfile  *ProfileBeanDto `json:"-"`
	AppliedProfile *ProfileBeanDto `json:"-"`
	Platforms      []string        `json:"-"`
}

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=350"`
	BuildxDriverType BuildxDriver `json:"buildxDriverType" default:"kubernetes"`
	Active           bool         `json:"active"`
	Type             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 ProfileBeanDto added in v1.2.1

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

type ProfileBeanV0

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

Deprecated

type ProfileResponse

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

type ProfileResponseV0

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

Deprecated

type ProfileType added in v1.2.1

type ProfileType string
const DEFAULT ProfileType = "DEFAULT"
const GLOBAL ProfileType = "GLOBAL"
const NORMAL ProfileType = "NORMAL"

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