types

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceTypeWorkflow    = "workflow"
	ResourceTypeEnvironment = "environment"
	ResourceTypeTest        = "test"

	WorkflowTypeCustomeWorkflow = "common_workflow"
)

collaboration mode resource type

View Source
const (
	// workflow actions for collaboration
	WorkflowActionView  = "get_workflow"
	WorkflowActionEdit  = "edit_workflow"
	WorkflowActionRun   = "run_workflow"
	WorkflowActionDebug = "debug_workflow"
	// env actions for collaboration
	EnvActionView       = "get_environment"
	EnvActionEditConfig = "config_environment"
	EnvActionManagePod  = "manage_environment"
	EnvActionDebug      = "debug_pod"
	// production env actions
	ProductionEnvActionView       = "get_production_environment"
	ProductionEnvActionEditConfig = "config_production_environment"
	ProductionEnvActionManagePod  = "edit_production_environment"
	ProductionEnvActionDebug      = "production_debug_pod"
	// test actions
	TestActionView = "get_test"
	// scan actions
	ScanActionView = "get_scan"
	// service actions
	ServiceActionView = "get_service"
	// build actions
	BuildActionView = "get_build"
	// delivery actions
	DeliveryActionView = "get_delivery"
)

collaboration mode resource actions

View Source
const (
	JobResultKey  = "job-result"
	JobOutputsKey = "job-outputs"

	JobDebugStatusKey    = "job-debug-status"
	JobDebugStatusBefore = "before"
	JobDebugStatusAfter  = "after"
	JobDebugStatusNotIn  = "not-in"
)
View Source
const (
	ZadigReleaseVersionLabelKey     = "zadigx-release-version"
	ZadigReleaseTypeLabelKey        = "zadigx-release-type"
	ZadigReleaseServiceNameLabelKey = "zadigx-release-service-name"
	ZadigReleaseMSEGrayTagLabelKey  = "alicloud.service.tag"
)
View Source
const (
	ZadigReleaseVersionOriginal = "original"

	ZadigReleaseTypeMseGray   = "mse-gray"
	ZadigReleaseTypeBlueGreen = "blue-green"
)
View Source
const (
	SystemScope  PolicyMetaScope = "system"
	ProjectScope PolicyMetaScope = "project"

	DBProjectScope int = 1
	DBSystemScope  int = 2
)
View Source
const (
	// ProviderGithub ...
	ProviderGithub = "github"
	// ProviderGitlab ...
	ProviderGitlab = "gitlab"

	// ProviderGerrit
	ProviderGerrit = "gerrit"

	// ProviderGitee
	ProviderGitee = "gitee"

	// ProviderGiteeEE
	ProviderGiteeEE = "gitee-enterprise"

	// ProviderOther
	ProviderOther = "other"
)
View Source
const (
	AllUserGroupName = "所有用户"
)
View Source
const DebugImage = "koderover.tencentcloudcr.com/koderover-public/zadig-debug:v0.1.0"
View Source
const DevmodeWorkDir = "/home/zadig/"
View Source
const DindContainerName = "dind"
View Source
const DindMountName = "zadig-docker"
View Source
const DindMountPath = "/var/lib/docker"
View Source
const DindStatefulSetName = "dind"
View Source
const IDEContainerNameDev = "dev"
View Source
const IDEContainerNameSidecar = "sidecar"
View Source
const IDESidecarImage = "koderover.tencentcloudcr.com/koderover-public/zgctl-sidecar:20220526172433-amd64"
View Source
const IstioLabelKeyInjection = "istio-injection"
View Source
const IstioLabelValueInjection = "enabled"
View Source
const (
	ScanningTypeSonar = "sonarQube"
)
View Source
const Zadig = "zadig"
View Source
const ZadigDomain = "zadig.koderover.com"

Variables

View Source
var OriginSpec = fmt.Sprintf("%s/origin", ZadigDomain)
View Source
var ZadigLabelKeyGlobalOwner = fmt.Sprintf("%s/owner", ZadigDomain)

Functions

func GetShareStorageSubPath

func GetShareStorageSubPath(workflowName, storageName string, taskID int64) string

func GetShareStorageSubPathPrefix

func GetShareStorageSubPathPrefix(workflowName string, taskID int64) string

Types

type ActionRule

type ActionRule struct {
	Method          string       `json:"method"`
	Endpoint        string       `json:"endpoint"`
	ResourceType    string       `json:"resourceType,omitempty"`
	IDRegex         string       `json:"idRegex,omitempty"`
	MatchAttributes []*Attribute `json:"matchAttributes,omitempty"`
	Filter          bool         `json:"filter,omitempty"`
}

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type AuthType

type AuthType string
const (
	SSHAuthType                AuthType = "SSH"
	PrivateAccessTokenAuthType AuthType = "PrivateAccessToken"
)

type BranchFilterInfo

type BranchFilterInfo struct {
	// repository identifier
	CodehostID    int    `bson:"codehost_id"  json:"codehost_id"`
	RepoOwner     string `bson:"repo_owner"   json:"repo_owner"`
	RepoName      string `bson:"repo_name"    json:"repo_name"`
	RepoNamespace string `bson:"repo_namespace" json:"repo_namespace"`
	// actual regular expression filter
	FilterRegExp  string `bson:"filter_regexp"  json:"filter_regexp"`
	DefaultBranch string `bson:"default_branch" json:"default_branch"`
}

func (*BranchFilterInfo) GetNamespace

func (bf *BranchFilterInfo) GetNamespace() string

type Cache

type Cache struct {
	MediumType       MediumType       `json:"medium_type"       bson:"medium_type"`
	ObjectProperties ObjectProperties `json:"object_properties" bson:"object_properties"`
	NFSProperties    NFSProperties    `json:"nfs_properties"    bson:"nfs_properties"`
}

type CacheDirType

type CacheDirType string
const (
	WorkspaceCacheDir   CacheDirType = "workspace"
	UserDefinedCacheDir CacheDirType = "user_defined"
)

type CheckCollaborationModePermissionReq

type CheckCollaborationModePermissionReq struct {
	UID          string `json:"uid" form:"uid"`
	ProjectKey   string `json:"project_key" form:"project_key"`
	Resource     string `json:"resource" form:"resource"`
	ResourceName string `json:"resource_name" form:"resource_name"`
	Action       string `json:"action" form:"action"`
}

type CheckCollaborationModePermissionResp

type CheckCollaborationModePermissionResp struct {
	HasPermission bool   `json:"has_permission"`
	Error         string `json:"error"`
}

type CollaborationEnvPermission

type CollaborationEnvPermission struct {
	Error       string   `json:"error"`
	ReadEnvList []string `json:"read_env_list"`
	EditEnvList []string `json:"edit_env_list"`
}

type CronTag

type CronTag string
const (
	CleanDockerTag CronTag = "CleanDockerTag"
)

type CronjobResource

type CronjobResource struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
	Spec struct {
		Template struct {
			Spec struct {
				Template struct {
					Spec struct {
						Containers []map[string]interface{} `yaml:"containers"`
					} `yaml:"spec"`
				} `yaml:"template"`
			} `yaml:"spec"`
		} `yaml:"jobTemplate"`
	} `yaml:"spec"`
}

type CustomTheme

type CustomTheme struct {
	BorderGray               string `json:"border_gray"`
	FontGray                 string `json:"font_gray"`
	FontLightGray            string `json:"font_light_gray"`
	ThemeColor               string `json:"theme_color"`
	ThemeBorderColor         string `json:"theme_border_color"`
	ThemeBackgroundColor     string `json:"theme_background_color"`
	ThemeLightColor          string `json:"theme_light_color"`
	BackgroundColor          string `json:"background_color"`
	GlobalBackgroundColor    string `json:"global_background_color"`
	Success                  string `json:"success"`
	Danger                   string `json:"danger"`
	Warning                  string `json:"warning"`
	Info                     string `json:"info"`
	Primary                  string `json:"primary"`
	WarningLight             string `json:"warning_light"`
	NotRunning               string `json:"not_running"`
	PrimaryColor             string `json:"primary_color"`
	SecondaryColor           string `json:"secondary_color"`
	SidebarBg                string `json:"sidebar_bg"`
	SidebarActiveColor       string `json:"sidebar_active_color"`
	ProjectItemIconColor     string `json:"project_item_icon_color"`
	ProjectNameColor         string `json:"project_name_color"`
	TableCellBackgroundColor string `json:"table_cell_background_color"`
	LinkColor                string `json:"link_color"`
}

type DetailedRole

type DetailedRole struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	Description string `json:"desc"`
	Type        string `json:"type"`
	// ResourceActions represents a set of verbs with its corresponding resource.
	// the json response of this field `rules` is used for compatibility.
	ResourceActions []*ResourceAction `json:"rules"`
}

type DetailedRoleTemplate added in v2.3.1

type DetailedRoleTemplate struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	Description string `json:"desc"`
	// ResourceActions represents a set of verbs with its corresponding resource.
	// the json response of this field `rules` is used for compatibility.
	ResourceActions []*ResourceAction `json:"rules"`
}

type DetailedUserGroupResp

type DetailedUserGroupResp struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Type        string   `json:"type"`
	UIDs        []string `json:"uids"`
}

type DindPod

type DindPod struct {
	ClusterID   string
	ClusterName string
	Pod         *corev1.Pod
	Err         error
}

type DockerBuildInfo

type DockerBuildInfo struct {
	WorkingDirectory    string `json:"working_directory"`
	DockerfileType      string `json:"dockerfile_type"` // it can be of local or template type
	DockerfileDirectory string `json:"dockerfile_directory"`
	BuildArgs           string `json:"build_args"`
	// when the dockerfile type is template, this field will be used to find the ID of the template
	TemplateName string `json:"template_name"`
	TemplateID   string `json:"template_id"`
}

DockerBuildInfo is the struct for docker build in the product workflow Mind that the templateID will be empty in the openAPI mode

type EnvType

type EnvType string
const (
	GeneralEnv EnvType = "general"
	ShareEnv   EnvType = "share"
)

type ExternalParamMapping

type ExternalParamMapping struct {
	// zadig parameter key
	ParamKey string `json:"param_key"`
	// response parameter key
	ResponseKey string `json:"response_key"`
	Display     bool   `json:"display"`
}

type ExternalSetting

type ExternalSetting struct {
	SystemID string                  `json:"system_id"`
	Endpoint string                  `json:"endpoint"`
	Method   string                  `json:"method"`
	Headers  []*KV                   `json:"headers"`
	Body     string                  `json:"body"`
	Params   []*ExternalParamMapping `json:"params"`
}

type FileInfo

type FileInfo struct {
	// parent path of the file
	Parent string `json:"parent"`
	// base name of the file
	Name string `json:"name"`
	// length in bytes for regular files; system-dependent for others
	Size int64 `json:"size"`
	// file mode bits
	Mode os.FileMode `json:"mode"`
	// modification time
	ModTime int64 `json:"mod_time"`
	// abbreviation for Mode().IsDir()
	IsDir bool `json:"is_dir"`
}

FileInfo ...

type HTTPGetAction

type HTTPGetAction struct {
	Path                string        `bson:"path"                        json:"path"`
	Port                int           `bson:"port"                        json:"port"`
	Host                string        `bson:"-"                           json:"host,omitempty"`
	HTTPHeaders         []*HTTPHeader `bson:"http_headers"                json:"http_headers"`
	TimeOutSecond       int           `bson:"timeout_second"              json:"timeout_second"`
	ResponseSuccessFlag string        `bson:"response_success_flag"       json:"response_success_flag"`
}

type HTTPHeader

type HTTPHeader struct {
	Name  string `bson:"name"                 json:"name"`
	Value string `bson:"value"                json:"value"`
}

type Identity

type Identity struct {
	IdentityType string `json:"identity_type"`
	UID          string `json:"uid,omitempty"`
	GID          string `json:"gid,omitempty"`
}

func (*Identity) GetID added in v2.3.1

func (id *Identity) GetID() string

type JenkinsBuildParam

type JenkinsBuildParam struct {
	Name         string           `bson:"name,omitempty"                json:"name,omitempty"`
	Value        interface{}      `bson:"value,omitempty"               json:"value,omitempty"`
	Type         JenkinsParamType `bson:"type,omitempty"                json:"type,omitempty"`
	AutoGenerate bool             `bson:"auto_generate,omitempty"       json:"auto_generate,omitempty"`
	ChoiceOption []string         `bson:"choice_option,omitempty"       json:"choice_option,omitempty"`
}

type JenkinsParamType

type JenkinsParamType string
const (
	Str    JenkinsParamType = "string"
	Choice JenkinsParamType = "choice"
)

type JobStatus

type JobStatus string
const (
	JobSuccess JobStatus = "success"
	JobFail    JobStatus = "fail"
)

type KV

type KV struct {
	Key          string `json:"key"`
	Value        string `json:"value"`
	Type         string `json:"type,omitempty"`
	IsCredential bool   `json:"is_credential,omitempty"`
}

type KubeResource

type KubeResource struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
	Spec struct {
		Template struct {
			Spec struct {
				Containers []map[string]interface{} `yaml:"containers"`
			} `yaml:"spec"`
		} `yaml:"template"`
	} `yaml:"spec"`
}

type KubeResourceKind

type KubeResourceKind struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string `yaml:"name"`
	} `yaml:"metadata"`
}

type ListAuthorizedEnvsReq

type ListAuthorizedEnvsReq struct {
	UID        string `json:"uid" form:"uid"`
	ProjectKey string `json:"project_key" form:"project_key"`
}

type ListAuthorizedProjectResp

type ListAuthorizedProjectResp struct {
	ProjectList []string `json:"project_list"`
	Found       bool     `json:"found"`
	Error       string   `json:"error"`
}

type ListAuthorizedWorkflowsReq

type ListAuthorizedWorkflowsReq struct {
	UID        string `json:"uid" form:"uid"`
	ProjectKey string `json:"project_key" form:"project_key"`
}

type ListAuthorizedWorkflowsResp

type ListAuthorizedWorkflowsResp struct {
	WorkflowList       []string `json:"workflow_list"`
	CustomWorkflowList []string `json:"custom_workflow_list"`
	Error              string   `json:"error"`
}

type ListUserGroupResp added in v2.3.1

type ListUserGroupResp struct {
	GroupList []*UserGroupResp `json:"group_list"`
	Count     int64            `json:"total"`
}

type MatchAttribute

type MatchAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type MediumType

type MediumType string
const (
	ObjectMedium MediumType = "object"
	NFSMedium    MediumType = "nfs"
)

type NFSProperties

type NFSProperties struct {
	ProvisionType    ProvisionType `json:"provision_type"      bson:"provision_type"         yaml:"provision_type"`
	StorageClass     string        `json:"storage_class"       bson:"storage_class"          yaml:"storage_class"`
	StorageSizeInGiB int64         `json:"storage_size_in_gib" bson:"storage_size_in_gib"    yaml:"storage_size_in_gib"`
	PVC              string        `json:"pvc"                 bson:"pvc"                    yaml:"pvc"`
	Subpath          string        `json:"subpath"             bson:"subpath"                yaml:"subpath"`
}

type NacosConfig

type NacosConfig struct {
	DataID          string `bson:"data_id"                 json:"data_id"                 yaml:"data_id"`
	Group           string `bson:"group"                   json:"group"                   yaml:"group"`
	Desc            string `bson:"description,omitempty"   json:"description,omitempty"   yaml:"description,omitempty"`
	Format          string `bson:"format,omitempty"        json:"format,omitempty"        yaml:"format,omitempty"`
	Content         string `bson:"content,omitempty"       json:"content,omitempty"       yaml:"content,omitempty"`
	OriginalContent string `bson:"original_content,omitempty" json:"original_content,omitempty" yaml:"original_content,omitempty"`
	NamespaceID     string `bson:"namespace_id"               json:"namespace_id"               yaml:"namespace_id"`
	NamespaceName   string `bson:"namespace_name"             json:"namespace_name"             yaml:"namespace_name"`

	// for frontend
	Diff        interface{} `bson:"diff,omitempty" json:"diff,omitempty" yaml:"diff,omitempty"`
	Persistence interface{} `bson:"persistence,omitempty" json:"persistence,omitempty" yaml:"persistence,omitempty"`
}

type NacosNamespace

type NacosNamespace struct {
	NamespaceID    string `json:"namespace_id"`
	NamespacedName string `json:"namespace_name"`
}

type ObjectProperties

type ObjectProperties struct {
	ID string `json:"id" bson:"id"`
}

Note: In the current design, when the object storage is used as the cache medium, the default object storage will be used as the cache medium, but in the near future users may be allowed to select different object storage as the cache medium according to the cluster. So it is temporarily reserved in `v1.10.0`, but do not use.

type ObjectStorageInfo

type ObjectStorageInfo struct {
	Endpoint string `bson:"endpoint" json:"endpoint" yaml:"endpoint"`
	AK       string `bson:"AK"       json:"AK"       yaml:"AK"`
	SK       string `bson:"SK"       json:"SK"       yaml:"SK"`
	Bucket   string `bson:"bucket"   json:"bucket"   yaml:"bucket"`
	Insecure bool   `bson:"insecure" json:"insecure" yaml:"insecure"`
	Provider int8   `bson:"provider" json:"provider" yaml:"provider"`
	Region   string `bson:"region"   json:"region"   yaml:"region"`
}

type ObjectStoragePathDetail

type ObjectStoragePathDetail struct {
	FilePath        string `bson:"file_path" json:"file_path" yaml:"file_path"`
	AbsFilePath     string `bson:"abs_file_path" json:"abs_file_path" yaml:"abs_file_path"`
	DestinationPath string `bson:"dest_path" json:"dest_path" yaml:"dest_path"`
}

type OpenAPIAdvancedSetting

type OpenAPIAdvancedSetting struct {
	ClusterName  string                 `json:"cluster_name"`
	StrategyName string                 `json:"strategy_name"`
	Timeout      int64                  `json:"timeout"`
	Spec         setting.RequestSpec    `json:"resource_spec"`
	Webhooks     *OpenAPIWebhookSetting `json:"webhooks,omitempty"`
	// Cache settings is for build only for now, remove this line if there are further changes
	CacheSetting        *OpenAPICacheSetting `json:"cache_setting"`
	UseHostDockerDaemon bool                 `json:"use_host_docker_daemon"`
}

type OpenAPICacheSetting

type OpenAPICacheSetting struct {
	Enabled  bool   `json:"enabled"`
	CacheDir string `json:"cache_dir"`
}

type OpenAPIRepoInput

type OpenAPIRepoInput struct {
	CodeHostName  string `json:"codehost_name"`
	RepoNamespace string `json:"repo_namespace"`
	RepoName      string `json:"repo_name"`
	Branch        string `json:"branch"`
	PR            int    `json:"pr"`
	PRs           []int  `json:"prs"`
	RemoteName    string `json:"remote_name"`
	CheckoutPath  string `json:"checkout_path"`
	SubModules    bool   `json:"submodules"`
}

type OpenAPIServiceBuildArgs

type OpenAPIServiceBuildArgs struct {
	ServiceModule string              `json:"service_module"`
	ServiceName   string              `json:"service_name"`
	RepoInfo      []*OpenAPIRepoInput `json:"repo_info"`
	Inputs        []*KV               `json:"inputs"`
}

type OpenAPIWebhookConfigDetail

type OpenAPIWebhookConfigDetail struct {
	CodeHostName  string                 `json:"codehost_name"`
	RepoNamespace string                 `json:"repo_namespace"`
	RepoName      string                 `json:"repo_name"`
	Branch        string                 `json:"branch"`
	Events        []config.HookEventType `json:"events"`
	MatchFolders  []string               `json:"match_folders"`
}

type OpenAPIWebhookSetting

type OpenAPIWebhookSetting struct {
	Enabled  bool                          `json:"enabled"`
	HookList []*OpenAPIWebhookConfigDetail `json:"hook_list"`
}

type ParameterSetting

type ParameterSetting struct {
	// External type parameter will NOT use this key.
	Key  string               `json:"key"`
	Type ParameterSettingType `json:"type"`
	//DefaultValue defines the default value of the parameter
	DefaultValue string `json:"default_value"`
	// choiceOption Are all options enumerated
	ChoiceOption []string `json:"choice_option"`
	// ExternalSetting It is the configuration of the external system to obtain the variable
	ExternalSetting *ExternalSetting `json:"external_setting"`
	IsCredential    bool             `json:"is_credential"`
}

type ParameterSettingType

type ParameterSettingType string
const (
	StringType   ParameterSettingType = "string"
	ChoiceType   ParameterSettingType = "choice"
	ExternalType ParameterSettingType = "external"
)

type Policy

type Policy struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	UpdateTime  int64   `json:"update_time"`
	Rules       []*Rule `json:"rules"`
}

type PolicyMeta

type PolicyMeta struct {
	Resource    string      `json:"resource"`
	Alias       string      `json:"alias"`
	Description string      `json:"description"`
	Rules       []*RuleMeta `json:"rules"`
}

type PolicyMetaScope

type PolicyMetaScope string

PolicyMetaScope resource scope for permission

type PolicyRule

type PolicyRule struct {
	Methods  []string `json:"methods"`
	Endpoint string   `json:"endpoint"`
}

type Probe

type Probe struct {
	ProbeScheme string         `bson:"probe_type"                 json:"probe_type"`
	HttpProbe   *HTTPGetAction `bson:"http_probe"                 json:"http_probe"`
}

type ProvisionType

type ProvisionType string
const (
	DynamicProvision ProvisionType = "dynamic"
	StaticProvision  ProvisionType = "static"
)

type ReaperType

type ReaperType string
const (
	BuildReaperType    ReaperType = "Build"
	TestReaperType     ReaperType = "Test"
	ScanningReaperType ReaperType = "Scanning"
)

type RepoSource

type RepoSource string
const (
	RepoSourceRuntime RepoSource = ""
	RepoSourceParam   RepoSource = "param"
	RepoSourceJob     RepoSource = "job"
)

type Repository

type Repository struct {
	Source        string `bson:"source,omitempty"          json:"source,omitempty"         yaml:"source,omitempty"`
	RepoOwner     string `bson:"repo_owner"                json:"repo_owner"               yaml:"repo_owner"`
	RepoNamespace string `bson:"repo_namespace"            json:"repo_namespace"           yaml:"repo_namespace"`
	RepoName      string `bson:"repo_name"                 json:"repo_name"                yaml:"repo_name"`
	RemoteName    string `bson:"remote_name,omitempty"     json:"remote_name,omitempty"    yaml:"remote_name,omitempty"`
	Branch        string `bson:"branch"                    json:"branch"                   yaml:"branch"`
	PR            int    `bson:"pr,omitempty"              json:"pr,omitempty"             yaml:"pr,omitempty"`
	PRs           []int  `bson:"prs,omitempty"             json:"prs,omitempty"            yaml:"prs,omitempty"`
	Tag           string `bson:"tag,omitempty"             json:"tag,omitempty"            yaml:"tag,omitempty"`
	// EnableCommit marks if the pull uses a commit instead of branch/pr
	EnableCommit  bool   `bson:"enable_commit"          json:"enable_commit"         yaml:"enable_commit"`
	CommitID      string `bson:"commit_id,omitempty"       json:"commit_id,omitempty"      yaml:"commit_id,omitempty"`
	CommitMessage string `bson:"commit_message,omitempty"  json:"commit_message,omitempty" yaml:"commit_message,omitempty"`
	CheckoutPath  string `bson:"checkout_path,omitempty"   json:"checkout_path,omitempty"  yaml:"checkout_path,omitempty"`
	SubModules    bool   `bson:"submodules,omitempty"      json:"submodules,omitempty"     yaml:"submodules,omitempty"`
	// Hidden defines whether the frontend needs to hide this repo
	Hidden bool `bson:"hidden" json:"hidden" yaml:"hidden"`
	// UseDefault defines if the repo can be configured in start pipeline task page
	UseDefault bool `bson:"use_default,omitempty"          json:"use_default,omitempty"    yaml:"use_default,omitempty"`
	// IsPrimary used to generated image and package name, each build has one primary repo
	IsPrimary  bool `bson:"is_primary"                     json:"is_primary"               yaml:"is_primary"`
	CodehostID int  `bson:"codehost_id"                    json:"codehost_id"              yaml:"codehost_id"`
	// add
	OauthToken  string `bson:"oauth_token"                  json:"oauth_token"             yaml:"oauth_token"`
	Address     string `bson:"address"                      json:"address"                 yaml:"address"`
	AuthorName  string `bson:"author_name,omitempty"        json:"author_name,omitempty"   yaml:"author_name,omitempty"`
	CheckoutRef string `bson:"checkout_ref,omitempty"       json:"checkout_ref,omitempty"  yaml:"checkout_ref,omitempty"`
	// username/password authorization
	Username string `bson:"username,omitempty"           json:"username,omitempty"      yaml:"username,omitempty"`
	Password string `bson:"password,omitempty"           json:"password,omitempty"      yaml:"password,omitempty"`
	// Now EnableProxy is not something we store. We decide this on runtime
	EnableProxy bool `bson:"-"       json:"enable_proxy,omitempty"                         yaml:"enable_proxy,omitempty"`
	// FilterRegexp is the regular expression filter for the branches and tags
	FilterRegexp string `bson:"filter_regexp,omitempty"    json:"filter_regexp,omitempty"                        yaml:"filter_regexp,omitempty"`
	// The address of the code base input of the other type
	AuthType           AuthType `bson:"auth_type,omitempty"             json:"auth_type,omitempty"               yaml:"auth_type,omitempty"`
	SSHKey             string   `bson:"ssh_key,omitempty"               json:"ssh_key,omitempty"                 yaml:"ssh_key,omitempty"`
	PrivateAccessToken string   `bson:"private_access_token,omitempty"  json:"private_access_token,omitempty"    yaml:"private_access_token,omitempty"`
	/*
		repo can come from params or other job, introduced in 1.3.1
	*/
	SourceFrom      RepoSource `bson:"source_from"               json:"source_from"                 yaml:"source_from"`
	GlobalParamName string     `bson:"param_name"    json:"param_name"    yaml:"param_name"`
	JobName         string     `bson:"job_name"      json:"job_name"      yaml:"job_name"`
	ServiceName     string     `bson:"service_name"  json:"service_name"  yaml:"service_name"`
	ServiceModule   string     `bson:"service_module" json:"service_module" yaml:"service_module"`
	JobRepoIndex    int        `bson:"repo_index" json:"repo_index" yaml:"repo_index"`
	SubmissionID    string     `bson:"submission_id" json:"submission_id" yaml:"submission_id"`
}

Repository struct

func (*Repository) BranchRef

func (r *Repository) BranchRef() string

BranchRef returns branch refs format e.g. refs/heads/master

func (*Repository) GetReleaseCandidateTag

func (repo *Repository) GetReleaseCandidateTag(taskID int64) string

GetReleaseCandidateTag 返回待发布对象Tag Branch: 20060102150405-{TaskID}-master PR: 20060102150405-{TaskID}-pr-1765 Branch + PR: 20060102150405-{TaskID}-master-pr-1276 Tag: 20060102150405-{TaskID}-v0.9.1

func (*Repository) GetRepoNamespace

func (repo *Repository) GetRepoNamespace() string

func (*Repository) PRRef

func (r *Repository) PRRef() string

PRRef returns refs format It will check repo provider type, by default returns github refs format.

e.g. github returns refs/pull/1/head e.g. gitlab returns merge-requests/1/head

func (*Repository) PRRefByPRID

func (r *Repository) PRRefByPRID(pr int) string

func (*Repository) Ref

func (r *Repository) Ref() string

Ref returns the changes ref of current repo in the following order: 1. tag ref 2. branch ref 3. pr ref

func (*Repository) TagRef

func (r *Repository) TagRef() string

TagRef returns the tag ref of current repo e.g. refs/tags/v1.0.0

type ResourceAction

type ResourceAction struct {
	Resource string   `json:"resource"`
	Verbs    []string `json:"verbs"`
}

type Role

type Role struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	Description string `json:"desc"`
	Type        string `json:"type"`
}

type RoleBinding

type RoleBinding struct {
	Name   string               `json:"name"`
	UID    string               `json:"uid"`
	Role   string               `json:"role"`
	Preset bool                 `json:"preset"`
	Type   setting.ResourceType `json:"type"`
}

type RoleTemplate added in v2.3.1

type RoleTemplate struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	Description string `json:"desc"`
	Type        int    `json:"type"`
}

type Rule

type Rule struct {
	Verbs           []string         `json:"verbs"`
	Resources       []string         `json:"resources"`
	Kind            string           `json:"kind"`
	MatchAttributes []MatchAttribute `json:"match_attributes"`
}

type RuleMeta

type RuleMeta struct {
	Action      string        `json:"action"`
	Alias       string        `json:"alias"`
	Description string        `json:"description"`
	Rules       []*ActionRule `json:"rules"`
}

type ScriptType

type ScriptType string
const (
	ScriptTypeShell      ScriptType = "shell"
	ScriptTypeBatchFile  ScriptType = "batch_file"
	ScriptTypePowerShell ScriptType = "powershell"
)

type ShareStorage

type ShareStorage struct {
	MediumType    MediumType    `json:"medium_type"       bson:"medium_type"           yaml:"medium_type"`
	NFSProperties NFSProperties `json:"nfs_properties"    bson:"nfs_properties"        yaml:"nfs_properties"`
}

type SourceFrom

type SourceFrom struct {
	Enabled    bool       `bson:"enabled"       json:"enabled"       yaml:"enabled"`
	SourceType RepoSource `bson:"source_type"   json:"source_type"   yaml:"source_type"`
}

repo source, repo can come from params or other job

type StartDevmodeInfo

type StartDevmodeInfo struct {
	DevImage string `json:"dev_image"`
}

type StorageClassType

type StorageClassType string
const (
	StorageClassAll StorageClassType = "all"
)

type Theme

type Theme struct {
	ThemeType   string       `json:"theme_type"`
	CustomTheme *CustomTheme `json:"custom_theme"`
}

type UserBriefInfo

type UserBriefInfo struct {
	UID          string `json:"uid"`
	Account      string `json:"account"`
	Name         string `json:"name"`
	IdentityType string `json:"identity_type"`
}

type UserCountByType

type UserCountByType struct {
	IdentityType string `gorm:"default:'unknown'" json:"identity_type" gorm:"identity_type"`
	Count        int64  `json:"count" gorm:"count"`
}

type UserGroupResp added in v2.3.1

type UserGroupResp struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	UserTotal   int64  `json:"user_total"`
}

type UserInfo

type UserInfo struct {
	LastLoginTime      int64          `json:"last_login_time"`
	Uid                string         `json:"uid"`
	Name               string         `json:"name"`
	IdentityType       string         `gorm:"default:'unknown'" json:"identity_type"`
	Email              string         `json:"email"`
	Phone              string         `json:"phone"`
	Account            string         `json:"account"`
	APIToken           string         `json:"token"`
	SystemRoleBindings []*RoleBinding `json:"system_role_bindings"`
	Admin              bool           `json:"admin"`
}

type UserSetting

type UserSetting struct {
	Uid          string `json:"uid"`
	Theme        string `json:"theme"`
	LogBgColor   string `json:"log_bg_color"`
	LogFontColor string `json:"log_font_color"`
}

type UserStatistics

type UserStatistics struct {
	UserByType []*UserCountByType `json:"user_info"`
	ActiveUser int64              `json:"active_user"`
	TotalUser  int64              `json:"total_user"`
}

type UsersBriefResp

type UsersBriefResp struct {
	Users      []*UserBriefInfo `json:"users"`
	TotalCount int64            `json:"total_count"`
}

type UsersResp

type UsersResp struct {
	Users      []*UserInfo `json:"users"`
	TotalCount int64       `json:"total_count"`
}

type WorkloadInfo

type WorkloadInfo struct {
	PodName      string `json:"pod_name"`
	PodNamespace string `json:"pod_namespace"`
}

type WorkloadType

type WorkloadType string
const (
	DeploymentWorkload  WorkloadType = "deployment"
	StatefulSetWorkload WorkloadType = "statefulset"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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