bean

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

Documentation

Index

Constants

View Source
const (
	NoDeploymentDoneForSelectedImage      = "there were no deployments done for the selected image"
	ExpectedWfrIdNotPassedInQueryParamErr = "wfrId is expected in the query param which was not passed"
	SecretMaskedValue                     = "********"
	SecretMaskedValueLong                 = "************"
)
View Source
const (
	InvalidConfigTypeErr = "invalid config type provided, please send a valid config type"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppEnvAndClusterMetadata added in v1.1.0

type AppEnvAndClusterMetadata struct {
	AppId     int
	EnvId     int
	ClusterId int
}

type CmCsMetadataDto added in v1.0.0

type CmCsMetadataDto struct {
	CmMap            map[string]*bean3.ConfigData
	SecretMap        map[string]*bean3.ConfigData
	ConfigAppLevelId int
	ConfigEnvLevelId int
}

type CmCsScopeVariableMetadata added in v1.1.0

type CmCsScopeVariableMetadata struct {
	ResolvedConfigData []*bean.ConfigData
	VariableSnapShot   map[string]map[string]string
}

type ComparisonItemRequestDto added in v1.1.0

type ComparisonItemRequestDto struct {
	Index int `json:"index"`
	*ConfigDataQueryParams
}

type ComparisonRequestDto added in v1.1.0

type ComparisonRequestDto struct {
	ComparisonItems []*ComparisonItemRequestDto `json:"comparisonItems"` // comparisonItems contains array of objects that a user wants to compare
}

func (*ComparisonRequestDto) GetAppName added in v1.1.0

func (r *ComparisonRequestDto) GetAppName() string

func (*ComparisonRequestDto) UpdateUserIdInComparisonItems added in v1.1.0

func (r *ComparisonRequestDto) UpdateUserIdInComparisonItems(userId int32)

revisit this maybe we can extract userId out in ComparisonRequestDto,

type ComparisonResponseDto added in v1.1.0

type ComparisonResponseDto struct {
	ComparisonItemResponse []*DeploymentAndCmCsConfigDto `json:"comparisonItemResponse"`
}

func DefaultComparisonResponseDto added in v1.1.0

func DefaultComparisonResponseDto() *ComparisonResponseDto

func (*ComparisonResponseDto) WithComparisonItemResponse added in v1.1.0

func (r *ComparisonResponseDto) WithComparisonItemResponse(comparisonItemResponse []*DeploymentAndCmCsConfigDto) *ComparisonResponseDto

type ConfigArea added in v1.0.0

type ConfigArea string
const (
	AppConfiguration  ConfigArea = "AppConfiguration"
	DeploymentHistory ConfigArea = "DeploymentHistory"
	CdRollback        ConfigArea = "CdRollback"
	ResolveData       ConfigArea = "ResolveData"
)

func (ConfigArea) ToString added in v1.0.0

func (r ConfigArea) ToString() string

type ConfigDataQueryParams

type ConfigDataQueryParams struct {
	AppName      string `schema:"appName" json:"appName"`
	EnvName      string `schema:"envName" json:"envName"`
	ConfigType   string `schema:"configType" json:"configType"`
	IdentifierId int    `schema:"identifierId" json:"identifierId"`
	PipelineId   int    `schema:"pipelineId" json:"pipelineId"`     // req for fetching previous deployments data
	ResourceName string `schema:"resourceName" json:"resourceName"` // used in case of cm and cs
	ResourceType string `schema:"resourceType" json:"resourceType"` // used in case of cm and cs
	ResourceId   int    `schema:"resourceId" json:"resourceId"`     // used in case of cm and cs
	UserId       int32  `schema:"-"`
	WfrId        int    `schema:"wfrId" json:"wfrId"`
	ConfigArea   string `schema:"configArea" json:"configArea"`
}

func (*ConfigDataQueryParams) IsEnvNameProvided

func (r *ConfigDataQueryParams) IsEnvNameProvided() bool

func (*ConfigDataQueryParams) IsRequestMadeForOneResource

func (r *ConfigDataQueryParams) IsRequestMadeForOneResource() bool

func (*ConfigDataQueryParams) IsResourceTypeConfigMap

func (r *ConfigDataQueryParams) IsResourceTypeConfigMap() bool

func (*ConfigDataQueryParams) IsResourceTypeSecret

func (r *ConfigDataQueryParams) IsResourceTypeSecret() bool

FilterCriteria []string `schema:"filterCriteria"` OffSet int `schema:"offSet"` Limit int `schema:"limit"`

func (*ConfigDataQueryParams) IsValidConfigType

func (r *ConfigDataQueryParams) IsValidConfigType() bool

type ConfigDataResponse

type ConfigDataResponse struct {
	ResourceConfig []*ConfigProperty `json:"resourceConfig"`
}

func NewConfigDataResponse

func NewConfigDataResponse() *ConfigDataResponse

func (*ConfigDataResponse) WithResourceConfig

func (r *ConfigDataResponse) WithResourceConfig(resourceConfig []*ConfigProperty) *ConfigDataResponse

type ConfigProperty

type ConfigProperty struct {
	Id          int               `json:"id"`
	Name        string            `json:"name"`
	ConfigState ConfigState       `json:"configState"`
	Type        bean.ResourceType `json:"type"`
	ConfigStage ConfigStage       `json:"configStage"`
}

func NewConfigProperty

func NewConfigProperty() *ConfigProperty

func (*ConfigProperty) GetIdentifier

func (r *ConfigProperty) GetIdentifier() ConfigPropertyIdentifier

func (*ConfigProperty) GetKey

func (r *ConfigProperty) GetKey() string

func (*ConfigProperty) IsConfigPropertyGlobal

func (r *ConfigProperty) IsConfigPropertyGlobal() bool

type ConfigPropertyIdentifier

type ConfigPropertyIdentifier struct {
	Name string            `json:"name"`
	Type bean.ResourceType `json:"type"`
}

type ConfigStage

type ConfigStage string
const (
	Env        ConfigStage = "Env"
	Inheriting ConfigStage = "Inheriting"
	Overridden ConfigStage = "Overridden"
)

type ConfigState

type ConfigState string
const (
	PublishedConfigState ConfigState = "PublishedOnly"
	DraftOnly            ConfigState = "DraftOnly"
	PublishedWithDraft   ConfigState = "PublishedWithDraft"
	PreviousDeployments  ConfigState = "PreviousDeployments"
	DefaultVersion       ConfigState = "DefaultVersion"
)

func (ConfigState) ToString

func (r ConfigState) ToString() string

type DeploymentAndCmCsConfig

type DeploymentAndCmCsConfig struct {
	ResourceType     bean.ResourceType            `json:"resourceType"`
	Data             json.RawMessage              `json:"data"`
	VariableSnapshot map[string]map[string]string `json:"variableSnapshot"` // for deployment->{Deployment Template: resolvedValuesMap}, for cm->{cmComponentName: resolvedValuesMap}
	ResolvedValue    json.RawMessage              `json:"resolvedValue"`
	// for deployment template
	TemplateVersion     string `json:"templateVersion,omitempty"`
	IsAppMetricsEnabled bool   `json:"isAppMetricsEnabled,omitempty"`
	//for pipeline strategy
	PipelineTriggerType pipelineConfig.TriggerType `json:"pipelineTriggerType,omitempty"`
	Strategy            string                     `json:"strategy,omitempty"`
}

func NewDeploymentAndCmCsConfig

func NewDeploymentAndCmCsConfig() *DeploymentAndCmCsConfig

func (*DeploymentAndCmCsConfig) WithConfigData

func (*DeploymentAndCmCsConfig) WithDeploymentConfigMetadata added in v1.0.0

func (r *DeploymentAndCmCsConfig) WithDeploymentConfigMetadata(templateVersion string, isAppMetricsEnabled bool) *DeploymentAndCmCsConfig

func (*DeploymentAndCmCsConfig) WithPipelineStrategyMetadata added in v1.0.0

func (r *DeploymentAndCmCsConfig) WithPipelineStrategyMetadata(pipelineTriggerType pipelineConfig.TriggerType, strategy string) *DeploymentAndCmCsConfig

func (*DeploymentAndCmCsConfig) WithResolvedValue added in v1.0.0

func (r *DeploymentAndCmCsConfig) WithResolvedValue(resolvedValue json.RawMessage) *DeploymentAndCmCsConfig

func (*DeploymentAndCmCsConfig) WithResourceType

func (r *DeploymentAndCmCsConfig) WithResourceType(resourceType bean.ResourceType) *DeploymentAndCmCsConfig

func (*DeploymentAndCmCsConfig) WithVariableSnapshot added in v1.0.0

func (r *DeploymentAndCmCsConfig) WithVariableSnapshot(snapshot map[string]map[string]string) *DeploymentAndCmCsConfig

type DeploymentAndCmCsConfigDto

type DeploymentAndCmCsConfigDto struct {
	DeploymentTemplate *DeploymentAndCmCsConfig `json:"deploymentTemplate"`
	ConfigMapsData     *DeploymentAndCmCsConfig `json:"configMapData"`
	SecretsData        *DeploymentAndCmCsConfig `json:"secretsData"`
	PipelineConfigData *DeploymentAndCmCsConfig `json:"pipelineConfigData,omitempty"`
	IsAppAdmin         bool                     `json:"isAppAdmin"`
	Index              int                      `json:"index"`
}

func NewDeploymentAndCmCsConfigDto

func NewDeploymentAndCmCsConfigDto() *DeploymentAndCmCsConfigDto

func (*DeploymentAndCmCsConfigDto) WithConfigMapData

func (*DeploymentAndCmCsConfigDto) WithDeploymentTemplateData

func (*DeploymentAndCmCsConfigDto) WithIndex added in v1.1.0

func (*DeploymentAndCmCsConfigDto) WithPipelineConfigData added in v1.0.0

func (*DeploymentAndCmCsConfigDto) WithSecretData

type DeploymentTemplateMetadata added in v1.0.0

type DeploymentTemplateMetadata struct {
	DeploymentTemplateJson json.RawMessage
	TemplateVersion        string
	IsAppMetricsEnabled    bool
}

type ManifestRequest added in v1.1.0

type ManifestRequest struct {
	Values             json.RawMessage      `json:"values"`
	MergeStrategy      models.MergeStrategy `json:"mergeStrategy"`
	ResourceType       bean.ResourceType    `json:"resourceType"`
	ResourceId         int                  `json:"resourceId"`
	ResourceName       string               `json:"resourceName"`
	AppId              int                  `json:"appId"`
	EnvironmentId      int                  `json:"environmentId"`
	UserHasAdminAccess bool                 `json:"-"`
}

type ManifestResponse added in v1.1.0

type ManifestResponse struct {
	Manifest string `json:"manifest"`
}

type ResolvedCmCsMetadataDto added in v1.0.0

type ResolvedCmCsMetadataDto struct {
	ResolvedConfigMapData string
	ResolvedSecretData    string
	VariableMapCM         map[string]map[string]string
	VariableMapCS         map[string]map[string]string
}

type Resource added in v1.1.0

type Resource string
const (
	ConfigMap          Resource = "cm"
	Secret             Resource = "secret"
	DeploymentTemplate Resource = "dt"
	PipelineStrategy   Resource = "ps"
)

func (Resource) ToString added in v1.1.0

func (r Resource) ToString() string

type SecretConfigMetadata added in v1.1.0

type SecretConfigMetadata struct {
	SecretsList                 *bean.SecretsList
	SecretScopeVariableMetadata *CmCsScopeVariableMetadata
}

type ValuesDto added in v1.0.0

type ValuesDto struct {
	Values string `json:"values"`
}

Jump to

Keyboard shortcuts

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