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

Documentation

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            = "Empty values for both pluginVersionIds and parentPluginIds. Please provide at least one of them"
	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 GlobalPluginDetailsRequest added in v1.1.0

type GlobalPluginDetailsRequest struct {
	PluginIds               []int    `schema:"pluginId" json:"pluginIds"`
	ParentPluginIds         []int    `schema:"parentPluginId" json:"parentPluginIds"`
	FetchAllVersionDetails  bool     `schema:"fetchAllVersionDetails" json:"fetchAllVersionDetails"`
	ParentPluginIdentifier  string   `schema:"parentPluginIdentifier"` // comma separated parentPluginIdentifiers
	ParentPluginIdentifiers []string `schema:"-" json:"parentPluginIdentifiers"`
	AppId                   int      `schema:"appId" json:"appId"`
}

type PluginDetailDto

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

type PluginDetailsMinQuery added in v1.1.0

type PluginDetailsMinQuery struct {
	AppId int `schema:"appId"`
	// Supports SHARED, PRESET, ALL.
	// Default is SHARED to maintain backward compatibility.
	// Note: Type is string as schema.NewDecoder does not support derived types - PluginType
	Type string `schema:"type,default:SHARED"`
}

func (*PluginDetailsMinQuery) GetPluginType added in v1.1.0

func (r *PluginDetailsMinQuery) GetPluginType() PluginType

func (*PluginDetailsMinQuery) IsValidPluginType added in v1.1.0

func (r *PluginDetailsMinQuery) IsValidPluginType() bool

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"`
	Identifier      string `json:"pluginIdentifier"`
	Type            string `json:"type,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) WithPluginIdentifier added in v1.1.0

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

func (*PluginMinDto) WithPluginName added in v0.7.3

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

func (*PluginMinDto) WithPluginType added in v1.1.0

func (r *PluginMinDto) WithPluginType(pluginType repository.PluginType) *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 PluginType added in v1.1.0

type PluginType string
const (
	ALL    PluginType = "ALL"
	PRESET PluginType = "PRESET"
	SHARED PluginType = "SHARED"
)

func GetPluginType added in v1.1.0

func GetPluginType(t string) PluginType

func (PluginType) ToString added in v1.1.0

func (r PluginType) ToString() string

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"`
}

func (*PluginVariableDto) GetValue added in v1.1.0

func (s *PluginVariableDto) GetValue() string

func (*PluginVariableDto) IsEmptyValue added in v1.1.0

func (s *PluginVariableDto) IsEmptyValue() bool

func (*PluginVariableDto) IsEmptyValueAllowed added in v1.1.0

func (s *PluginVariableDto) IsEmptyValueAllowed() bool

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