chart

package
v0.0.0-...-987a61a Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfigResponse

type AppConfigResponse struct {
	//DefaultAppConfig  json.RawMessage `json:"defaultAppConfig"`
	//AppConfig         TemplateRequest            `json:"appConfig"`
	LatestAppConfig   TemplateRequest `json:"latestAppConfig"`
	PreviousAppConfig TemplateRequest `json:"previousAppConfig"`
}

type AppMetricEnableDisableRequest

type AppMetricEnableDisableRequest struct {
	AppId               int   `json:"appId,omitempty"`
	EnvironmentId       int   `json:"environmentId,omitempty"`
	IsAppMetricsEnabled bool  `json:"isAppMetricsEnabled"`
	UserId              int32 `json:"-"`
}

type AppMetricsEnabled

type AppMetricsEnabled struct {
	AppMetrics bool `json:"app-metrics"`
}

type ChartDataInfo

type ChartDataInfo struct {
	ChartLocation   string `json:"chartLocation"`
	ChartName       string `json:"chartName"`
	ChartVersion    string `json:"chartVersion"`
	TemporaryFolder string `json:"temporaryFolder"`
	Description     string `json:"description"`
	Message         string `json:"message"`
}

type ChartDto

type ChartDto struct {
	Name             string `json:"name"`
	ChartDescription string `json:"chartDescription"`
	Version          string `json:"version"`
}

type ChartService

type ChartService interface {
	Create(templateRequest TemplateRequest, ctx context.Context) (chart *TemplateRequest, err error)
	CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (chart *TemplateRequest, err error)
	FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)
	GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]interface{}, error)
	UpdateAppOverride(templateRequest *TemplateRequest) (*TemplateRequest, error)
	IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)
	ChartRefAutocomplete() ([]chartRef, error)
	ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefResponse, error)
	FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)
	UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]interface{}, userId int32, ctx context.Context) (bool, error)
	AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)
	DeploymentTemplateValidate(templatejson interface{}, chartRefId int) (bool, error)
	JsonSchemaExtractFromFile(chartRefId int) (map[string]interface{}, error)
	GetSchemaAndReadmeForTemplateByChartRefId(chartRefId int) (schema []byte, readme []byte, err error)
	ExtractChartIfMissing(chartData []byte, refChartDir string, location string) (*ChartDataInfo, error)
	CheckChartExists(chartRefId int) error
	GetLocationFromChartNameAndVersion(chartName string, chartVersion string) string
	ValidateUploadedFileFormat(fileName string) error
	ReadChartMetaDataForLocation(chartDir string, fileName string) (*ChartYamlStruct, error)
	RegisterInArgo(chartGitAttribute *util.ChartGitAttribute, ctx context.Context) error
	FetchChartInfoByFlag(userUploaded bool) ([]*ChartDto, error)
	CheckCustomChartByAppId(id int) (bool, error)
	CheckCustomChartByChartId(id int) (bool, error)
}

type ChartServiceImpl

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

func NewChartServiceImpl

func NewChartServiceImpl(chartRepository chartRepoRepository.ChartRepository,
	logger *zap.SugaredLogger,
	chartTemplateService util.ChartTemplateService,
	repoRepository chartRepoRepository.ChartRepoRepository,
	pipelineGroupRepository app.AppRepository,
	refChartDir chartRepoRepository.RefChartDir,
	defaultChart DefaultChart,
	mergeUtil util.MergeUtil,
	repositoryService repository.ServiceClient,
	chartRefRepository chartRepoRepository.ChartRefRepository,
	envOverrideRepository chartConfig.EnvConfigOverrideRepository,
	pipelineConfigRepository chartConfig.PipelineConfigRepository,
	configMapRepository chartConfig.ConfigMapRepository,
	environmentRepository repository4.EnvironmentRepository,
	pipelineRepository pipelineConfig.PipelineRepository,
	appLevelMetricsRepository repository3.AppLevelMetricsRepository,
	envLevelAppMetricsRepository repository3.EnvLevelAppMetricsRepository,
	client *http.Client,
	deploymentTemplateHistoryService history.DeploymentTemplateHistoryService) *ChartServiceImpl

func (ChartServiceImpl) AppMetricsEnableDisable

func (impl ChartServiceImpl) AppMetricsEnableDisable(appMetricRequest AppMetricEnableDisableRequest) (*AppMetricEnableDisableRequest, error)

func (ChartServiceImpl) ChartRefAutocomplete

func (impl ChartServiceImpl) ChartRefAutocomplete() ([]chartRef, error)

func (ChartServiceImpl) ChartRefAutocompleteForAppOrEnv

func (impl ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefResponse, error)

func (ChartServiceImpl) CheckChartExists

func (impl ChartServiceImpl) CheckChartExists(chartRefId int) error

func (ChartServiceImpl) CheckCustomChartByAppId

func (impl ChartServiceImpl) CheckCustomChartByAppId(id int) (bool, error)

func (ChartServiceImpl) CheckCustomChartByChartId

func (impl ChartServiceImpl) CheckCustomChartByChartId(id int) (bool, error)

func (ChartServiceImpl) Create

func (impl ChartServiceImpl) Create(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)

func (ChartServiceImpl) CreateChartFromEnvOverride

func (impl ChartServiceImpl) CreateChartFromEnvOverride(templateRequest TemplateRequest, ctx context.Context) (*TemplateRequest, error)

func (ChartServiceImpl) DeploymentTemplateValidate

func (impl ChartServiceImpl) DeploymentTemplateValidate(templatejson interface{}, chartRefId int) (bool, error)

func (ChartServiceImpl) ExtractChartIfMissing

func (impl ChartServiceImpl) ExtractChartIfMissing(chartData []byte, refChartDir string, location string) (*ChartDataInfo, error)

func (ChartServiceImpl) FetchChartInfoByFlag

func (impl ChartServiceImpl) FetchChartInfoByFlag(userUploaded bool) ([]*ChartDto, error)

func (ChartServiceImpl) FindLatestChartForAppByAppId

func (impl ChartServiceImpl) FindLatestChartForAppByAppId(appId int) (chartTemplate *TemplateRequest, err error)

func (ChartServiceImpl) FindPreviousChartByAppId

func (impl ChartServiceImpl) FindPreviousChartByAppId(appId int) (chartTemplate *TemplateRequest, err error)

func (ChartServiceImpl) GetAppOverrideForDefaultTemplate

func (impl ChartServiceImpl) GetAppOverrideForDefaultTemplate(chartRefId int) (map[string]interface{}, error)

func (ChartServiceImpl) GetByAppIdAndChartRefId

func (impl ChartServiceImpl) GetByAppIdAndChartRefId(appId int, chartRefId int) (chartTemplate *TemplateRequest, err error)

func (*ChartServiceImpl) GetLocationFromChartNameAndVersion

func (impl *ChartServiceImpl) GetLocationFromChartNameAndVersion(chartName string, chartVersion string) string

func (ChartServiceImpl) GetSchemaAndReadmeForTemplateByChartRefId

func (impl ChartServiceImpl) GetSchemaAndReadmeForTemplateByChartRefId(chartRefId int) ([]byte, []byte, error)

func (ChartServiceImpl) IsReadyToTrigger

func (impl ChartServiceImpl) IsReadyToTrigger(appId int, envId int, pipelineId int) (IsReady, error)

func (ChartServiceImpl) JsonSchemaExtractFromFile

func (impl ChartServiceImpl) JsonSchemaExtractFromFile(chartRefId int) (map[string]interface{}, error)

func (ChartServiceImpl) ReadChartMetaDataForLocation

func (impl ChartServiceImpl) ReadChartMetaDataForLocation(chartDir string, fileName string) (*ChartYamlStruct, error)

func (ChartServiceImpl) RegisterInArgo

func (impl ChartServiceImpl) RegisterInArgo(chartGitAttribute *util.ChartGitAttribute, ctx context.Context) error

func (ChartServiceImpl) UpdateAppOverride

func (impl ChartServiceImpl) UpdateAppOverride(templateRequest *TemplateRequest) (*TemplateRequest, error)

func (ChartServiceImpl) UpgradeForApp

func (impl ChartServiceImpl) UpgradeForApp(appId int, chartRefId int, newAppOverride map[string]interface{}, userId int32, ctx context.Context) (bool, error)

func (*ChartServiceImpl) ValidateUploadedFileFormat

func (impl *ChartServiceImpl) ValidateUploadedFileFormat(fileName string) error

type ChartUpgradeRequest

type ChartUpgradeRequest struct {
	ChartRefId int   `json:"chartRefId"  validate:"number"`
	All        bool  `json:"all"`
	AppIds     []int `json:"appIds"`
	UserId     int32 `json:"-"`
}

type ChartYamlStruct

type ChartYamlStruct struct {
	Name        string `yaml:"name"`
	Version     string `yaml:"version"`
	Description string `yaml:"description"`
}

type DefaultChart

type DefaultChart string

type IsReady

type IsReady struct {
	Flag    bool   `json:"flag"`
	Message string `json:"message"`
}

type PipelineConfigRequest

type PipelineConfigRequest struct {
	Id                   int             `json:"id"  validate:"number"`
	AppId                int             `json:"appId,omitempty"  validate:"number,required"`
	EnvConfigOverrideId  int             `json:"envConfigOverrideId,omitempty"`
	PipelineConfigValues json.RawMessage `json:"pipelineConfigValues,omitempty" validate:"required"` //json format user value
	PipelineId           int             `json:"PipelineId,omitempty"`
	Latest               bool            `json:"latest"`
	Previous             bool            `json:"previous"`
	EnvId                int             `json:"envId,omitempty"`
	ManualReviewed       bool            `json:"manualReviewed" validate:"required"`
	UserId               int32           `json:"-"`
}

type PipelineConfigRequestResponse

type PipelineConfigRequestResponse struct {
	LatestPipelineConfigRequest   PipelineConfigRequest `json:"latestPipelineConfigRequest"`
	PreviousPipelineConfigRequest PipelineConfigRequest `json:"previousPipelineConfigRequest"`
}

type TemplateRequest

type TemplateRequest struct {
	Id                      int             `json:"id"  validate:"number"`
	AppId                   int             `json:"appId,omitempty"  validate:"number,required"`
	RefChartTemplate        string          `json:"refChartTemplate,omitempty"`
	RefChartTemplateVersion string          `json:"refChartTemplateVersion,omitempty"`
	ChartRepositoryId       int             `json:"chartRepositoryId,omitempty"`
	ValuesOverride          json.RawMessage `json:"valuesOverride,omitempty" validate:"required"` //json format user value
	DefaultAppOverride      json.RawMessage `json:"defaultAppOverride,omitempty"`                 //override values available
	ChartRefId              int             `json:"chartRefId,omitempty"  validate:"number"`
	Latest                  bool            `json:"latest"`
	IsAppMetricsEnabled     bool            `json:"isAppMetricsEnabled"`
	Schema                  json.RawMessage `json:"schema"`
	Readme                  string          `json:"readme"`
	UserId                  int32           `json:"-"`
}

Jump to

Keyboard shortcuts

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