bean

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

* Copyright (c) 2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

View Source
const (
	CREATEPLUGIN      = 0
	UPDATEPLUGIN      = 1
	DELETEPLUGIN      = 2
	CI_TYPE_PLUGIN    = "CI"
	CD_TYPE_PLUGIN    = "CD"
	CI_CD_TYPE_PLUGIN = "CI_CD"
)
View Source
const (
	NoPluginOrParentIdProvidedErr            = "no value for pluginVersionIds and parentPluginIds provided in query param"
	NoPluginFoundForThisSearchQueryErr       = "unable to find desired plugin for the query filter"
	PluginStepsNotProvidedError              = "plugin steps not provided"
	PluginWithSameNameExistError             = "plugin with the same name exists, please choose another name"
	PluginWithSameIdentifierExistsError      = "plugin with the same identifier exists, please choose another identifier name"
	PluginVersionNotSemanticallyCorrectError = "please provide a plugin version that adheres to Semantic Versioning 2.0.0 to ensure compatibility and proper versioning"
	PluginIconNotCorrectOrReachableError     = "cannot validate icon, make sure that provided url link is reachable"
	PluginVersionAlreadyExistError           = "this plugin version already exists, please provide another plugin version"
	NoStepDataToProceedError                 = "no step data provided to save, please provide a plugin step to proceed further"
)
View Source
const (
	SpecialCharsRegex        = ` !"#$%&'()*+,./:;<=>?@[\]^_{|}~` + "`"
	PluginIconMaxSizeInBytes = 2 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginDetailDto

type PluginDetailDto struct {
	Metadata        *PluginMetadataDto   `json:"metadata"`
	InputVariables  []*PluginVariableDto `json:"inputVariables"`
	OutputVariables []*PluginVariableDto `json:"outputVariables"`
}

type PluginListComponentDto

type PluginListComponentDto struct {
	*PluginMetadataDto
	InputVariables  []*PluginVariableDto `json:"inputVariables"`
	OutputVariables []*PluginVariableDto `json:"outputVariables"`
}

type PluginMetadataDto

type PluginMetadataDto struct {
	Id                int               `json:"id"`
	Name              string            `json:"name" validate:"required,min=3,max=100,global-entity-name"`
	Description       string            `json:"description" validate:"max=300"`
	Type              string            `json:"type,omitempty" validate:"oneof=SHARED PRESET"` // SHARED, PRESET etc
	Icon              string            `json:"icon,omitempty"`
	Tags              []string          `json:"tags"`
	Action            int               `json:"action,omitempty"`
	PluginStage       string            `json:"pluginStage,omitempty"`
	PluginSteps       []*PluginStepsDto `json:"pluginSteps,omitempty"`
	AreNewTagsPresent bool              `json:"areNewTagsPresent,omitempty"`
}

func (*PluginMetadataDto) GetPluginMetadataSqlObj

func (r *PluginMetadataDto) GetPluginMetadataSqlObj(userId int32) *repository.PluginMetadata

type PluginMinDto

type PluginMinDto struct {
	ParentPluginId  int    `json:"id,omitempty"`
	PluginName      string `json:"name,omitempty"`
	Icon            string `json:"icon,omitempty"`
	PluginVersionId int    `json:"pluginVersionId,omitempty"`
}

func NewPluginMinDto added in v0.7.3

func NewPluginMinDto() *PluginMinDto

func (*PluginMinDto) WithIcon added in v0.7.3

func (r *PluginMinDto) WithIcon(icon string) *PluginMinDto

func (*PluginMinDto) WithParentPluginId added in v0.7.3

func (r *PluginMinDto) WithParentPluginId(id int) *PluginMinDto

func (*PluginMinDto) WithPluginName added in v0.7.3

func (r *PluginMinDto) WithPluginName(name string) *PluginMinDto

func (*PluginMinDto) WithPluginVersionId added in v0.7.3

func (r *PluginMinDto) WithPluginVersionId(versionId int) *PluginMinDto

type PluginParentMetadataDto

type PluginParentMetadataDto struct {
	Id               int             `json:"id"`
	Name             string          `json:"name" validate:"required,min=3,max=100,global-entity-name"`
	PluginIdentifier string          `json:"pluginIdentifier" validate:"required,min=3,max=100,global-entity-name"`
	Description      string          `json:"description" validate:"max=300"`
	Type             string          `json:"type,omitempty" validate:"oneof=SHARED PRESET"`
	Icon             string          `json:"icon,omitempty"`
	Versions         *PluginVersions `json:"pluginVersions"`
}

func NewPluginParentMetadataDto

func NewPluginParentMetadataDto() *PluginParentMetadataDto

func (*PluginParentMetadataDto) WithDescription

func (r *PluginParentMetadataDto) WithDescription(desc string) *PluginParentMetadataDto

func (*PluginParentMetadataDto) WithIcon

func (*PluginParentMetadataDto) WithNameAndId

func (r *PluginParentMetadataDto) WithNameAndId(name string, id int) *PluginParentMetadataDto

func (*PluginParentMetadataDto) WithPluginIdentifier

func (r *PluginParentMetadataDto) WithPluginIdentifier(identifier string) *PluginParentMetadataDto

func (*PluginParentMetadataDto) WithType

func (r *PluginParentMetadataDto) WithType(pluginType string) *PluginParentMetadataDto

func (*PluginParentMetadataDto) WithVersions

type PluginPipelineScript

type PluginPipelineScript struct {
	Id                       int                                  `json:"id"`
	Script                   string                               `json:"script"`
	StoreScriptAt            string                               `json:"storeScriptAt"`
	Type                     repository.ScriptType                `json:"type"`
	DockerfileExists         bool                                 `json:"dockerfileExists"`
	MountPath                string                               `json:"mountPath"`
	MountCodeToContainer     bool                                 `json:"mountCodeToContainer"`
	MountCodeToContainerPath string                               `json:"mountCodeToContainerPath"`
	MountDirectoryFromHost   bool                                 `json:"mountDirectoryFromHost"`
	ContainerImagePath       string                               `json:"containerImagePath"`
	ImagePullSecretType      repository.ScriptImagePullSecretType `json:"imagePullSecretType"`
	ImagePullSecret          string                               `json:"imagePullSecret"`
	Deleted                  bool                                 `json:"deleted"`
	PathArgPortMapping       []*ScriptPathArgPortMapping          `json:"pathArgPortMapping"`
}

type PluginStepCondition

type PluginStepCondition struct {
	Id                  int                                `json:"id"`
	PluginStepId        int                                `json:"pluginStepId"`
	ConditionVariableId int                                `json:"conditionVariableId"` //id of variable on which condition is written
	ConditionType       repository.PluginStepConditionType `json:"conditionType"`
	ConditionalOperator string                             `json:"conditionalOperator"`
	ConditionalValue    string                             `json:"conditionalValue"`
	Deleted             bool                               `json:"deleted"`
}

type PluginStepsDto

type PluginStepsDto struct {
	Id                   int                       `json:"id,pk"`
	Name                 string                    `json:"name"`
	Description          string                    `json:"description"`
	Index                int                       `json:"index"`
	StepType             repository.PluginStepType `json:"stepType"`
	RefPluginId          int                       `json:"refPluginId"` //id of plugin used as reference
	OutputDirectoryPath  []string                  `json:"outputDirectoryPath"`
	DependentOnStep      string                    `json:"dependentOnStep"`
	PluginStepVariable   []*PluginVariableDto      `json:"pluginStepVariable,omitempty"`
	PluginPipelineScript *PluginPipelineScript     `json:"pluginPipelineScript,omitempty"`
}

type PluginTagsDto

type PluginTagsDto struct {
	TagNames []string `json:"tagNames"`
}

func NewPluginTagsDto

func NewPluginTagsDto() *PluginTagsDto

func (*PluginTagsDto) WithTagNames

func (r *PluginTagsDto) WithTagNames(tags []string) *PluginTagsDto

type PluginVariableDto

type PluginVariableDto struct {
	Id                        int                                     `json:"id,omitempty"`
	Name                      string                                  `json:"name"`
	Format                    repository.PluginStepVariableFormatType `json:"format"`
	Description               string                                  `json:"description"`
	IsExposed                 bool                                    `json:"isExposed"`
	AllowEmptyValue           bool                                    `json:"allowEmptyValue"`
	DefaultValue              string                                  `json:"defaultValue"`
	Value                     string                                  `json:"value,omitempty"`
	VariableType              repository.PluginStepVariableType       `json:"variableType"`
	ValueType                 repository.PluginStepVariableValueType  `json:"valueType,omitempty"`
	PreviousStepIndex         int                                     `json:"previousStepIndex,omitempty"`
	VariableStepIndex         int                                     `json:"variableStepIndex"`
	VariableStepIndexInPlugin int                                     `json:"variableStepIndexInPlugin"`
	ReferenceVariableName     string                                  `json:"referenceVariableName,omitempty"`
	PluginStepCondition       []*PluginStepCondition                  `json:"pluginStepCondition,omitempty"`
}

type PluginVersions

type PluginVersions struct {
	DetailedPluginVersionData []*PluginsVersionDetail `json:"detailedPluginVersionData"` // contains detailed data with all input and output variables
	MinimalPluginVersionData  []*PluginsVersionDetail `json:"minimalPluginVersionData"`  // contains only few metadata
}

func NewPluginVersions

func NewPluginVersions() *PluginVersions

func (*PluginVersions) WithDetailedPluginVersionData

func (r *PluginVersions) WithDetailedPluginVersionData(detailedPluginVersionData []*PluginsVersionDetail) *PluginVersions

func (*PluginVersions) WithMinimalPluginVersionData

func (r *PluginVersions) WithMinimalPluginVersionData(minimalPluginVersionData []*PluginsVersionDetail) *PluginVersions

type PluginsDto

type PluginsDto struct {
	ParentPlugins []*PluginParentMetadataDto `json:"parentPlugins"`
	TotalCount    int                        `json:"totalCount"`
}

func NewPluginsDto

func NewPluginsDto() *PluginsDto

func (*PluginsDto) WithParentPlugins

func (r *PluginsDto) WithParentPlugins(parentPlugins []*PluginParentMetadataDto) *PluginsDto

func (*PluginsDto) WithTotalCount

func (r *PluginsDto) WithTotalCount(count int) *PluginsDto

type PluginsListFilter

type PluginsListFilter struct {
	Offset                 int
	Limit                  int
	SearchKey              string
	Tags                   []string
	FetchAllVersionDetails bool
}

func NewPluginsListFilter

func NewPluginsListFilter() *PluginsListFilter

func (*PluginsListFilter) WithLimit

func (r *PluginsListFilter) WithLimit(limit int) *PluginsListFilter

func (*PluginsListFilter) WithOffset

func (r *PluginsListFilter) WithOffset(offset int) *PluginsListFilter

func (*PluginsListFilter) WithSearchKey

func (r *PluginsListFilter) WithSearchKey(searchKey string) *PluginsListFilter

func (*PluginsListFilter) WithTags

func (r *PluginsListFilter) WithTags(tags []string) *PluginsListFilter

type PluginsVersionDetail

type PluginsVersionDetail struct {
	*PluginMetadataDto
	InputVariables  []*PluginVariableDto `json:"inputVariables"`
	OutputVariables []*PluginVariableDto `json:"outputVariables"`
	DocLink         string               `json:"docLink"`
	Version         string               `json:"pluginVersion" validate:"max=50,min=3"`
	IsLatest        bool                 `json:"isLatest"`
	UpdatedBy       string               `json:"updatedBy"`
	CreatedOn       time.Time            `json:"-"`
}

func NewPluginsVersionDetail

func NewPluginsVersionDetail() *PluginsVersionDetail

func (*PluginsVersionDetail) SetMinimalPluginsVersionDetail

func (r *PluginsVersionDetail) SetMinimalPluginsVersionDetail(pluginVersionMetadata *repository.PluginMetadata) *PluginsVersionDetail

SetMinimalPluginsVersionDetail sets and return PluginsVersionDetail obj, returns lightweight obj e.g. excluding input and output variables

func (*PluginsVersionDetail) WithCreatedOn

func (r *PluginsVersionDetail) WithCreatedOn(createdOn time.Time) *PluginsVersionDetail

func (*PluginsVersionDetail) WithInputVariables

func (r *PluginsVersionDetail) WithInputVariables(inputVariables []*PluginVariableDto) *PluginsVersionDetail

func (*PluginsVersionDetail) WithLastUpdatedEmail

func (r *PluginsVersionDetail) WithLastUpdatedEmail(email string) *PluginsVersionDetail

func (*PluginsVersionDetail) WithOutputVariables

func (r *PluginsVersionDetail) WithOutputVariables(outputVariables []*PluginVariableDto) *PluginsVersionDetail

func (*PluginsVersionDetail) WithTags

func (r *PluginsVersionDetail) WithTags(tags []string) *PluginsVersionDetail

type RegistryCredentials

type RegistryCredentials struct {
	RegistryType       string `json:"registryType" validate:"required"`
	RegistryURL        string `json:"registryURL"`
	Username           string `json:"username"`
	Password           string `json:"password"`
	AWSAccessKeyId     string `json:"awsAccessKeyId,omitempty"`
	AWSSecretAccessKey string `json:"awsSecretAccessKey,omitempty"`
	AWSRegion          string `json:"awsRegion,omitempty"`
}

type ScriptPathArgPortMapping

type ScriptPathArgPortMapping struct {
	Id                  int                          `json:"id"`
	TypeOfMapping       repository.ScriptMappingType `json:"typeOfMapping"`
	FilePathOnDisk      string                       `json:"filePathOnDisk"`
	FilePathOnContainer string                       `json:"filePathOnContainer"`
	Command             string                       `json:"command"`
	Args                []string                     `json:"args"`
	PortOnLocal         int                          `json:"portOnLocal"`
	PortOnContainer     int                          `json:"portOnContainer"`
	ScriptId            int                          `json:"scriptId"`
}

Jump to

Keyboard shortcuts

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