model

package
Version: v1.3.5 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PayloadTypeCustom is the payload type custom
	PayloadTypeCustom = "custom"
	// PayloadTypeDockerhub is the payload type dockerhub
	PayloadTypeDockerhub = "dockerhub"
	// PayloadTypeACR is the payload type acr
	PayloadTypeACR = "acr"
	// PayloadTypeHarbor is the payload type harbor
	PayloadTypeHarbor = "harbor"
	// PayloadTypeJFrog is the payload type jfrog
	PayloadTypeJFrog = "jfrog"

	// ComponentTypeWebservice is the component type webservice
	ComponentTypeWebservice = "webservice"
	// ComponentTypeWorker is the component type worker
	ComponentTypeWorker = "worker"
	// ComponentTypeTask is the component type task
	ComponentTypeTask = "task"
)
View Source
const (
	// HarborEventTypePushArtifact is the event type PUSH_ARTIFACT
	HarborEventTypePushArtifact = "PUSH_ARTIFACT"
	// JFrogEventTypePush is push event type of jfrog webhook
	JFrogEventTypePush = "pushed"
	// JFrogDomainDocker is webhook domain of jfrog docker
	JFrogDomainDocker = "docker"
)
View Source
const (
	// ClusterStatusHealthy healthy cluster
	ClusterStatusHealthy = "Healthy"
	// ClusterStatusUnhealthy unhealthy cluster
	ClusterStatusUnhealthy = "Unhealthy"
)
View Source
const (
	// LoginTypeDex is the dex login type
	LoginTypeDex string = "dex"
	// LoginTypeLocal is the local login type
	LoginTypeLocal string = "local"
)
View Source
const (
	// AutoGenDesc describes the metadata in datastore that's automatically generated
	AutoGenDesc = "Automatically converted from KubeVela Application in Kubernetes."

	// AutoGenProj describes the automatically created project
	AutoGenProj = "Automatically generated by sync mechanism."

	// AutoGenEnvNamePrefix describes the common prefix for auto-generated env
	AutoGenEnvNamePrefix = "syc-"
	// AutoGenComp describes the creator of component that is auto-generated
	AutoGenComp = "syc-comp"
	// AutoGenPolicy describes the creator of policy that is auto-generated
	AutoGenPolicy = "syc-policy"
	// AutoGenRefPolicy describes the creator of policy that is auto-generated, this differs from AutoGenPolicy as the policy is referenced ones
	AutoGenRefPolicy = "syc-ref-policy"
	// AutoGenWorkflowNamePrefix describes the common prefix for auto-generated workflow
	AutoGenWorkflowNamePrefix = "syc-"
	// AutoGenTargetNamePrefix describes the common prefix for auto-generated target
	AutoGenTargetNamePrefix = "syc-"

	// LabelSyncGeneration describes the generation synced from
	LabelSyncGeneration = "ux.oam.dev/synced-generation"
	// LabelSyncNamespace describes the namespace synced from
	LabelSyncNamespace = "ux.oam.dev/from-namespace"
)
View Source
const (
	// LabelSourceOfTruth describes the source of this app
	LabelSourceOfTruth = "app.oam.dev/source-of-truth"

	// FromCR means the data source of truth is from k8s CR
	FromCR = "from-k8s-resource"
	// FromUX means the data source of truth is from velaux data store
	FromUX = "from-velaux"
	// FromInner means the data source of truth is from KubeVela inner usage, such as addon or configuration that don't want to be synced
	FromInner = "from-inner-system"
)
View Source
const (

	// DefaultInitName is default object name for initialization
	DefaultInitName = "default"

	// DefaultAddonProject is default addon projects
	DefaultAddonProject = "addons"

	// DefaultInitNamespace is default namespace name for initialization
	DefaultInitNamespace = "default"

	// DefaultTargetDescription describes default target created
	DefaultTargetDescription = "Default target is created by velaux system automatically."
	// DefaultEnvDescription describes default env created
	DefaultEnvDescription = "Default environment is created by velaux system automatically."
	// DefaultProjectDescription describes the default project created
	DefaultProjectDescription = "Default project is created by velaux system automatically."
)
View Source
const DefaultAdminUserName = "admin"

DefaultAdminUserName default admin user name

Variables

View Source
var (
	// LocalClusterCreatedTime create time for local cluster, set to late date in order to ensure it is sorted to first
	LocalClusterCreatedTime = time.Date(2999, 1, 1, 0, 0, 0, 0, time.UTC)
)
View Source
var RevisionStatusComplete = "complete"

RevisionStatusComplete event status complete

View Source
var RevisionStatusFail = "failure"

RevisionStatusFail event status failure

View Source
var RevisionStatusInit = "init"

RevisionStatusInit event status init

View Source
var RevisionStatusRollback = "rollback"

RevisionStatusRollback event status rollback

View Source
var RevisionStatusRunning = "running"

RevisionStatusRunning event status running

View Source
var RevisionStatusTerminated = "terminated"

RevisionStatusTerminated event status terminated

Functions

func GetRegisterModels added in v1.3.0

func GetRegisterModels() map[string]Interface

GetRegisterModels will return the register models

func RegisterModel added in v1.3.0

func RegisterModel(models ...Interface)

RegisterModel register model

Types

type Application added in v1.2.0

type Application struct {
	BaseModel
	Name        string            `json:"name"`
	Alias       string            `json:"alias"`
	Project     string            `json:"project"`
	Description string            `json:"description"`
	Icon        string            `json:"icon"`
	Labels      map[string]string `json:"labels,omitempty"`
}

Application application delivery model

func (*Application) GetAppNameForSynced added in v1.3.0

func (a *Application) GetAppNameForSynced() string

GetAppNameForSynced will trim namespace suffix for synced CR

func (*Application) GetAppNamespaceForSynced added in v1.3.0

func (a *Application) GetAppNamespaceForSynced() string

GetAppNamespaceForSynced will return the namespace of synced CR

func (*Application) Index added in v1.2.0

func (a *Application) Index() map[string]string

Index return custom index

func (*Application) IsSynced added in v1.3.0

func (a *Application) IsSynced() bool

IsSynced answer if the app is synced one

func (*Application) PrimaryKey added in v1.2.0

func (a *Application) PrimaryKey() string

PrimaryKey return custom primary key the app primary key is the app name, so the app name is globally unique in every namespace when the app is synced from CR, the first synced one be same with app name, if there's any conflicts, the name will be composed by <appname>-<namespace>

func (*Application) ShortTableName added in v1.3.0

func (a *Application) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*Application) TableName added in v1.2.0

func (a *Application) TableName() string

TableName return custom table name

type ApplicationComponent added in v1.2.0

type ApplicationComponent struct {
	BaseModel
	AppPrimaryKey string            `json:"appPrimaryKey"`
	Description   string            `json:"description,omitempty"`
	Labels        map[string]string `json:"labels,omitempty"`
	Icon          string            `json:"icon,omitempty"`
	Creator       string            `json:"creator"`
	Name          string            `json:"name"`
	Alias         string            `json:"alias"`
	Type          string            `json:"type"`
	Main          bool              `json:"main"`
	// ExternalRevision specified the component revisionName
	ExternalRevision string             `json:"externalRevision,omitempty"`
	Properties       *JSONStruct        `json:"properties,omitempty"`
	DependsOn        []string           `json:"dependsOn,omitempty"`
	Inputs           common.StepInputs  `json:"inputs,omitempty"`
	Outputs          common.StepOutputs `json:"outputs,omitempty"`
	// Traits define the trait of one component, the type must be array to keep the order.
	Traits []ApplicationTrait `json:"traits,omitempty"`
	// scopes in ApplicationComponent defines the component-level scopes
	// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
	Scopes map[string]string `json:"scopes,omitempty"`
}

ApplicationComponent component database model

func (*ApplicationComponent) Index added in v1.2.0

func (a *ApplicationComponent) Index() map[string]string

Index return custom index

func (*ApplicationComponent) PrimaryKey added in v1.2.0

func (a *ApplicationComponent) PrimaryKey() string

PrimaryKey return custom primary key

func (*ApplicationComponent) ShortTableName added in v1.3.0

func (a *ApplicationComponent) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*ApplicationComponent) TableName added in v1.2.0

func (a *ApplicationComponent) TableName() string

TableName return custom table name

type ApplicationPolicy added in v1.2.0

type ApplicationPolicy struct {
	BaseModel
	AppPrimaryKey string      `json:"appPrimaryKey"`
	Name          string      `json:"name"`
	Description   string      `json:"description"`
	Type          string      `json:"type"`
	Creator       string      `json:"creator"`
	Properties    *JSONStruct `json:"properties,omitempty"`
}

ApplicationPolicy app policy

func (*ApplicationPolicy) Index added in v1.2.0

func (a *ApplicationPolicy) Index() map[string]string

Index return custom index

func (*ApplicationPolicy) PrimaryKey added in v1.2.0

func (a *ApplicationPolicy) PrimaryKey() string

PrimaryKey return custom primary key

func (*ApplicationPolicy) ShortTableName added in v1.3.0

func (a *ApplicationPolicy) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*ApplicationPolicy) TableName added in v1.2.0

func (a *ApplicationPolicy) TableName() string

TableName return custom table name

type ApplicationRevision added in v1.2.0

type ApplicationRevision struct {
	BaseModel
	AppPrimaryKey   string `json:"appPrimaryKey"`
	Version         string `json:"version"`
	RollbackVersion string `json:"rollbackVersion,omitempty"`
	// ApplyAppConfig Stores the application configuration during the current deploy.
	ApplyAppConfig string `json:"applyAppConfig,omitempty"`

	// Deploy event status
	Status string `json:"status"`
	Reason string `json:"reason"`

	// The user that triggers the deploy.
	DeployUser string `json:"deployUser"`

	// Information that users can note.
	Note string `json:"note"`
	// TriggerType the event trigger source, Web or API
	TriggerType string `json:"triggerType"`

	// WorkflowName deploy controller by workflow
	WorkflowName string `json:"workflowName"`
	// EnvName is the env name of this application revision
	EnvName string `json:"envName"`
	// CodeInfo is the code info of this application revision
	CodeInfo *CodeInfo `json:"codeInfo,omitempty"`
	// ImageInfo is the image info of this application revision
	ImageInfo *ImageInfo `json:"imageInfo,omitempty"`
}

ApplicationRevision be created when an application initiates deployment and describes the phased version of the application.

func (*ApplicationRevision) Index added in v1.2.0

func (a *ApplicationRevision) Index() map[string]string

Index return custom index

func (*ApplicationRevision) PrimaryKey added in v1.2.0

func (a *ApplicationRevision) PrimaryKey() string

PrimaryKey return custom primary key

func (*ApplicationRevision) ShortTableName added in v1.3.0

func (a *ApplicationRevision) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*ApplicationRevision) TableName added in v1.2.0

func (a *ApplicationRevision) TableName() string

TableName return custom table name

type ApplicationTrait added in v1.2.0

type ApplicationTrait struct {
	Alias       string      `json:"alias"`
	Description string      `json:"description"`
	Type        string      `json:"type"`
	Properties  *JSONStruct `json:"properties,omitempty"`
	CreateTime  time.Time   `json:"createTime"`
	UpdateTime  time.Time   `json:"updateTime"`
}

ApplicationTrait application trait

type ApplicationTrigger added in v1.2.0

type ApplicationTrigger struct {
	BaseModel
	AppPrimaryKey string `json:"appPrimaryKey"`
	WorkflowName  string `json:"workflowName,omitempty"`
	Name          string `json:"name"`
	Alias         string `json:"alias,omitempty"`
	Description   string `json:"description,omitempty"`
	Token         string `json:"token"`
	Type          string `json:"type"`
	PayloadType   string `json:"payloadType"`
}

ApplicationTrigger is the model for trigger

func (*ApplicationTrigger) Index added in v1.2.0

func (w *ApplicationTrigger) Index() map[string]string

Index return custom index

func (*ApplicationTrigger) PrimaryKey added in v1.2.0

func (w *ApplicationTrigger) PrimaryKey() string

PrimaryKey return custom primary key

func (*ApplicationTrigger) ShortTableName added in v1.3.0

func (w *ApplicationTrigger) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*ApplicationTrigger) TableName added in v1.2.0

func (w *ApplicationTrigger) TableName() string

TableName return custom table name

type BaseModel added in v1.2.0

type BaseModel struct {
	CreateTime time.Time `json:"createTime"`
	UpdateTime time.Time `json:"updateTime"`
}

BaseModel common model

func (*BaseModel) SetCreateTime added in v1.2.0

func (m *BaseModel) SetCreateTime(time time.Time)

SetCreateTime set create time

func (*BaseModel) SetUpdateTime added in v1.2.0

func (m *BaseModel) SetUpdateTime(time time.Time)

SetUpdateTime set update time

type Cluster added in v1.2.0

type Cluster struct {
	BaseModel
	Name             string            `json:"name"`
	Alias            string            `json:"alias"`
	Description      string            `json:"description"`
	Icon             string            `json:"icon"`
	Labels           map[string]string `json:"labels"`
	Status           string            `json:"status"`
	Reason           string            `json:"reason"`
	Provider         ProviderInfo      `json:"provider"`
	APIServerURL     string            `json:"apiServerURL"`
	DashboardURL     string            `json:"dashboardURL"`
	KubeConfig       string            `json:"kubeConfig"`
	KubeConfigSecret string            `json:"kubeConfigSecret"`
}

Cluster describes the model of cluster in apiserver

func (*Cluster) DeepCopy added in v1.2.0

func (c *Cluster) DeepCopy() *Cluster

DeepCopy create a copy of cluster

func (*Cluster) Index added in v1.2.0

func (c *Cluster) Index() map[string]string

Index set to nil for list

func (*Cluster) PrimaryKey added in v1.2.0

func (c *Cluster) PrimaryKey() string

PrimaryKey primary key for datastore

func (*Cluster) SetCreateTime added in v1.2.0

func (c *Cluster) SetCreateTime(t time.Time)

SetCreateTime for local cluster, create time is set to a large date which ensures the order of list

func (*Cluster) ShortTableName added in v1.3.0

func (c *Cluster) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*Cluster) TableName added in v1.2.0

func (c *Cluster) TableName() string

TableName table name for datastore

type ClusterSelector added in v1.2.0

type ClusterSelector struct {
	Name string `json:"name"`
	// Adapt to a scenario where only one Namespace is available or a user-defined Namespace is available.
	Namespace string `json:"namespace,omitempty"`
}

ClusterSelector cluster selector

type ClusterTarget added in v1.2.0

type ClusterTarget struct {
	ClusterName string `json:"clusterName" validate:"checkname"`
	Namespace   string `json:"namespace" optional:"true"`
}

ClusterTarget one kubernetes cluster delivery target

type CodeInfo added in v1.2.0

type CodeInfo struct {
	// Commit is the commit hash
	Commit string `json:"commit,omitempty"`
	// Branch is the branch name
	Branch string `json:"branch,omitempty"`
	// User is the user name
	User string `json:"user,omitempty"`
}

CodeInfo is the code info for webhook request

type ComponentPatch added in v1.2.0

type ComponentPatch struct {
	Name        string       `json:"name"`
	Properties  *JSONStruct  `json:"properties,omitempty"`
	Disable     bool         `json:"disable"`
	TraitsPatch []TraitPatch `json:"traitsPatch,omitempty"`
}

ComponentPatch Define differential patches for components in the environment.

type ComponentSelector added in v1.2.0

type ComponentSelector struct {
	Components []string `json:"components"`
}

ComponentSelector component selector

type Condition added in v1.3.0

type Condition struct {
}

Condition is a model for a new RBAC mode.

type CustomClaims added in v1.3.0

type CustomClaims struct {
	Username  string `json:"username"`
	GrantType string `json:"grantType"`
	jwt.StandardClaims
}

CustomClaims is the custom claims

type DataStoreApp added in v1.3.0

type DataStoreApp struct {
	AppMeta  *Application
	Env      *Env
	Eb       *EnvBinding
	Comps    []*ApplicationComponent
	Policies []*ApplicationPolicy
	Workflow *Workflow
	Targets  []*Target
}

DataStoreApp is a memory struct that describes the model of an application in datastore

type DexConfig added in v1.3.0

type DexConfig struct {
	Issuer           string            `json:"issuer"`
	Web              DexWeb            `json:"web"`
	Storage          DexStorage        `json:"storage"`
	StaticClients    []DexStaticClient `json:"staticClients"`
	Connectors       []interface{}     `json:"connectors,omitempty"`
	EnablePasswordDB bool              `json:"enablePasswordDB"`
}

DexConfig dex config

type DexStaticClient added in v1.3.0

type DexStaticClient struct {
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Secret       string   `json:"secret"`
	RedirectURIs []string `json:"redirectURIs"`
}

DexStaticClient dex static client

type DexStorage added in v1.3.0

type DexStorage struct {
	Type string `json:"type"`
}

DexStorage dex storage

type DexWeb added in v1.3.0

type DexWeb struct {
	HTTP string `json:"http"`
}

DexWeb dex web

type Env added in v1.2.0

type Env struct {
	BaseModel
	Name        string `json:"name"`
	Alias       string `json:"alias"`
	Description string `json:"description,omitempty"`

	// Project defines the project this Env belongs to
	Project string `json:"project"`
	// Namespace defines the K8s namespace of the Env in control plane
	Namespace string `json:"namespace"`

	// Targets defines the name of delivery target that belongs to this env
	// In one project, a delivery target can only belong to one env.
	Targets []string `json:"targets,omitempty"`
}

Env models the data of env in database

func (*Env) Index added in v1.2.0

func (p *Env) Index() map[string]string

Index return custom index

func (*Env) PrimaryKey added in v1.2.0

func (p *Env) PrimaryKey() string

PrimaryKey return custom primary key

func (*Env) ShortTableName added in v1.3.0

func (p *Env) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*Env) TableName added in v1.2.0

func (p *Env) TableName() string

TableName return custom table name

type EnvBinding added in v1.2.0

type EnvBinding struct {
	BaseModel
	AppPrimaryKey   string           `json:"appPrimaryKey"`
	AppDeployName   string           `json:"appDeployName"`
	Name            string           `json:"name"`
	ComponentsPatch []ComponentPatch `json:"componentsPatchs"`
}

EnvBinding application env binding

func (*EnvBinding) Index added in v1.2.0

func (e *EnvBinding) Index() map[string]string

Index return custom index

func (*EnvBinding) PrimaryKey added in v1.2.0

func (e *EnvBinding) PrimaryKey() string

PrimaryKey return custom primary key

func (*EnvBinding) ShortTableName added in v1.3.0

func (e *EnvBinding) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*EnvBinding) TableName added in v1.2.0

func (e *EnvBinding) TableName() string

TableName return custom table name

type ImageInfo added in v1.2.0

type ImageInfo struct {
	// Type is the image type, ACR or Harbor or DockerHub
	Type string `json:"type"`
	// Resource is the image resource
	Resource *ImageResource `json:"resource,omitempty"`
	// Repository is the image repository
	Repository *ImageRepository `json:"repository,omitempty"`
}

ImageInfo is the image info for webhook request

type ImageRepository added in v1.2.0

type ImageRepository struct {
	// Name is the image repository name
	Name string `json:"name"`
	// Namespace is the image repository namespace
	Namespace string `json:"namespace"`
	// FullName is the image repository full name
	FullName string `json:"fullName"`
	// Region is the image repository region
	Region string `json:"region,omitempty"`
	// Type is the image repository type, public or private
	Type string `json:"type"`
	// CreateTime is the image repository create time
	CreateTime time.Time `json:"createTime,omitempty"`
}

ImageRepository is the image repository

type ImageResource added in v1.2.0

type ImageResource struct {
	// Digest is the image digest
	Digest string `json:"digest"`
	// Tag is the image tag
	Tag string `json:"tag"`
	// URL is the image url
	URL string `json:"url"`
	// CreateTime is the image create time
	CreateTime time.Time `json:"createTime,omitempty"`
}

ImageResource is the image resource

type Interface added in v1.2.0

type Interface interface {
	TableName() string
	ShortTableName() string
}

Interface model interface

type JSONStruct added in v1.2.0

type JSONStruct map[string]interface{}

JSONStruct json struct, same with runtime.RawExtension

func NewJSONStruct added in v1.2.0

func NewJSONStruct(raw *runtime.RawExtension) (*JSONStruct, error)

NewJSONStruct new json struct from runtime.RawExtension

func NewJSONStructByString added in v1.2.0

func NewJSONStructByString(source string) (*JSONStruct, error)

NewJSONStructByString new json struct from string

func NewJSONStructByStruct added in v1.2.0

func NewJSONStructByStruct(object interface{}) (*JSONStruct, error)

NewJSONStructByStruct new json struct from struct object

func (*JSONStruct) JSON added in v1.2.0

func (j *JSONStruct) JSON() string

JSON Encoded as a JSON string

func (*JSONStruct) RawExtension added in v1.2.0

func (j *JSONStruct) RawExtension() *runtime.RawExtension

RawExtension Encoded as a RawExtension

type Permission added in v1.3.0

type Permission struct {
	BaseModel
	Name      string   `json:"name"`
	Alias     string   `json:"alias"`
	Project   string   `json:"project,omitempty"`
	Resources []string `json:"resources"`
	Actions   []string `json:"actions"`
	// Effect option values: Allow,Deny
	Effect    string     `json:"effect"`
	Principal *Principal `json:"principal,omitempty"`
	Condition *Condition `json:"condition,omitempty"`
}

Permission is a model for a new RBAC mode.

func (*Permission) Index added in v1.3.0

func (p *Permission) Index() map[string]string

Index return custom index

func (*Permission) PrimaryKey added in v1.3.0

func (p *Permission) PrimaryKey() string

PrimaryKey return custom primary key

func (*Permission) ShortTableName added in v1.3.0

func (p *Permission) ShortTableName() string

ShortTableName return custom table name

func (*Permission) TableName added in v1.3.0

func (p *Permission) TableName() string

TableName return custom table name

type PermissionTemplate added in v1.3.0

type PermissionTemplate struct {
	BaseModel
	Name  string `json:"name"`
	Alias string `json:"alias"`
	// Scope options: project or platform
	Scope     string     `json:"scope"`
	Resources []string   `json:"resources"`
	Actions   []string   `json:"actions"`
	Effect    string     `json:"effect"`
	Condition *Condition `json:"condition,omitempty"`
}

PermissionTemplate is a model for a new RBAC mode.

func (*PermissionTemplate) Index added in v1.3.0

func (p *PermissionTemplate) Index() map[string]string

Index return custom index

func (*PermissionTemplate) PrimaryKey added in v1.3.0

func (p *PermissionTemplate) PrimaryKey() string

PrimaryKey return custom primary key

func (*PermissionTemplate) ShortTableName added in v1.3.0

func (p *PermissionTemplate) ShortTableName() string

ShortTableName return custom table name

func (*PermissionTemplate) TableName added in v1.3.0

func (p *PermissionTemplate) TableName() string

TableName return custom table name

type Principal added in v1.3.0

type Principal struct {
	// Type options: User or Role
	Type  string   `json:"type"`
	Names []string `json:"names"`
}

Principal is a model for a new RBAC mode.

type Project added in v1.2.0

type Project struct {
	BaseModel
	Name        string `json:"name"`
	Alias       string `json:"alias"`
	Owner       string `json:"owner"`
	Description string `json:"description,omitempty"`
}

Project basic model

func (*Project) Index added in v1.2.0

func (p *Project) Index() map[string]string

Index return custom index

func (*Project) PrimaryKey added in v1.2.0

func (p *Project) PrimaryKey() string

PrimaryKey return custom primary key

func (*Project) ShortTableName added in v1.3.0

func (p *Project) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*Project) TableName added in v1.2.0

func (p *Project) TableName() string

TableName return custom table name

type ProjectUser added in v1.3.0

type ProjectUser struct {
	BaseModel
	Username    string `json:"username"`
	ProjectName string `json:"projectName"`
	// UserRoles binding the project level roles
	UserRoles []string `json:"userRoles"`
}

ProjectUser is the model of user in project

func (*ProjectUser) Index added in v1.3.0

func (u *ProjectUser) Index() map[string]string

Index return custom index

func (*ProjectUser) PrimaryKey added in v1.3.0

func (u *ProjectUser) PrimaryKey() string

PrimaryKey return custom primary key

func (*ProjectUser) ShortTableName added in v1.3.0

func (u *ProjectUser) ShortTableName() string

ShortTableName return custom table name

func (*ProjectUser) TableName added in v1.3.0

func (u *ProjectUser) TableName() string

TableName return custom table name

type ProviderInfo added in v1.2.0

type ProviderInfo struct {
	Provider    string            `json:"provider"`
	ClusterID   string            `json:"clusterID"`
	ClusterName string            `json:"clusterName,omitempty"`
	Zone        string            `json:"zone,omitempty"`
	ZoneID      string            `json:"zoneID,omitempty"`
	RegionID    string            `json:"regionID,omitempty"`
	VpcID       string            `json:"vpcID,omitempty"`
	Labels      map[string]string `json:"labels"`
}

ProviderInfo describes the information from provider API

type Role added in v1.3.0

type Role struct {
	BaseModel
	Name        string   `json:"name"`
	Alias       string   `json:"alias"`
	Project     string   `json:"project,omitempty"`
	Permissions []string `json:"permissions"`
}

Role is a model for a new RBAC mode.

func (*Role) Index added in v1.3.0

func (r *Role) Index() map[string]string

Index return custom index

func (*Role) PrimaryKey added in v1.3.0

func (r *Role) PrimaryKey() string

PrimaryKey return custom primary key

func (*Role) ShortTableName added in v1.3.0

func (r *Role) ShortTableName() string

ShortTableName return custom table name

func (*Role) TableName added in v1.3.0

func (r *Role) TableName() string

TableName return custom table name

type StatisticInfo added in v1.3.2

type StatisticInfo struct {
	ClusterCount        string            `json:"clusterCount,omitempty"`
	AppCount            string            `json:"appCount,omitempty"`
	EnabledAddon        map[string]string `json:"enabledAddon,omitempty"`
	TopKCompDef         []string          `json:"topKCompDef,omitempty"`
	TopKTraitDef        []string          `json:"topKTraitDef,omitempty"`
	TopKWorkflowStepDef []string          `json:"topKWorkflowStepDef,omitempty"`
	TopKPolicyDef       []string          `json:"topKPolicyDef,omitempty"`
	UpdateTime          time.Time         `json:"updateTime,omitempty"`
}

StatisticInfo the system statistic info

type SystemInfo added in v1.2.0

type SystemInfo struct {
	BaseModel
	InstallID        string        `json:"installID"`
	EnableCollection bool          `json:"enableCollection"`
	LoginType        string        `json:"loginType"`
	DexConfig        DexConfig     `json:"dexConfig,omitempty"`
	StatisticInfo    StatisticInfo `json:"statisticInfo,omitempty"`
}

SystemInfo systemInfo model

func (*SystemInfo) Index added in v1.2.0

func (u *SystemInfo) Index() map[string]string

Index return custom index

func (*SystemInfo) PrimaryKey added in v1.2.0

func (u *SystemInfo) PrimaryKey() string

PrimaryKey return custom primary key

func (*SystemInfo) ShortTableName added in v1.3.0

func (u *SystemInfo) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*SystemInfo) TableName added in v1.2.0

func (u *SystemInfo) TableName() string

TableName return custom table name

type Target added in v1.2.0

type Target struct {
	BaseModel
	Name        string                 `json:"name"`
	Alias       string                 `json:"alias,omitempty"`
	Project     string                 `json:"project"`
	Description string                 `json:"description,omitempty"`
	Cluster     *ClusterTarget         `json:"cluster,omitempty"`
	Variable    map[string]interface{} `json:"variable,omitempty"`
}

Target defines the delivery target information for the application It includes kubernetes clusters or cloud service providers

func (*Target) Index added in v1.2.0

func (d *Target) Index() map[string]string

Index return custom index

func (*Target) PrimaryKey added in v1.2.0

func (d *Target) PrimaryKey() string

PrimaryKey return custom primary key

func (*Target) ShortTableName added in v1.3.0

func (d *Target) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*Target) TableName added in v1.2.0

func (d *Target) TableName() string

TableName return custom table name

type TraitPatch added in v1.2.0

type TraitPatch struct {
	Type       string      `json:"type"`
	Properties *JSONStruct `json:"properties,omitempty"`
	Disable    bool        `json:"disable"`
}

TraitPatch Define differential patches for traits in the environment.

type User added in v1.3.0

type User struct {
	BaseModel
	Name          string    `json:"name"`
	Email         string    `json:"email"`
	Alias         string    `json:"alias,omitempty"`
	Password      string    `json:"password,omitempty"`
	Disabled      bool      `json:"disabled"`
	LastLoginTime time.Time `json:"lastLoginTime,omitempty"`
	// UserRoles binding the platform level roles
	UserRoles []string `json:"userRoles"`
}

User is the model of user

func (*User) Index added in v1.3.0

func (u *User) Index() map[string]string

Index return custom index

func (*User) PrimaryKey added in v1.3.0

func (u *User) PrimaryKey() string

PrimaryKey return custom primary key

func (*User) ShortTableName added in v1.3.0

func (u *User) ShortTableName() string

ShortTableName return custom table name

func (*User) TableName added in v1.3.0

func (u *User) TableName() string

TableName return custom table name

type Workflow added in v1.2.0

type Workflow struct {
	BaseModel
	Name        string `json:"name"`
	Alias       string `json:"alias"`
	Description string `json:"description"`
	// Workflow used by the default
	Default       *bool          `json:"default"`
	AppPrimaryKey string         `json:"appPrimaryKey"`
	EnvName       string         `json:"envName"`
	Steps         []WorkflowStep `json:"steps,omitempty"`
}

Workflow application delivery database model

func (*Workflow) Index added in v1.2.0

func (w *Workflow) Index() map[string]string

Index return custom primary key

func (*Workflow) PrimaryKey added in v1.2.0

func (w *Workflow) PrimaryKey() string

PrimaryKey return custom primary key

func (*Workflow) ShortTableName added in v1.3.0

func (w *Workflow) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*Workflow) TableName added in v1.2.0

func (w *Workflow) TableName() string

TableName return custom table name

type WorkflowRecord added in v1.2.0

type WorkflowRecord struct {
	BaseModel
	WorkflowName       string               `json:"workflowName"`
	WorkflowAlias      string               `json:"workflowAlias"`
	AppPrimaryKey      string               `json:"appPrimaryKey"`
	RevisionPrimaryKey string               `json:"revisionPrimaryKey"`
	Name               string               `json:"name"`
	Namespace          string               `json:"namespace"`
	StartTime          time.Time            `json:"startTime,omitempty"`
	Finished           string               `json:"finished"`
	Steps              []WorkflowStepStatus `json:"steps,omitempty"`
	Status             string               `json:"status"`
}

WorkflowRecord is the workflow record database model

func (*WorkflowRecord) Index added in v1.2.0

func (w *WorkflowRecord) Index() map[string]string

Index return custom primary key

func (*WorkflowRecord) PrimaryKey added in v1.2.0

func (w *WorkflowRecord) PrimaryKey() string

PrimaryKey return custom primary key

func (*WorkflowRecord) ShortTableName added in v1.3.0

func (w *WorkflowRecord) ShortTableName() string

ShortTableName is the compressed version of table name for kubeapi storage and others

func (*WorkflowRecord) TableName added in v1.2.0

func (w *WorkflowRecord) TableName() string

TableName return custom table name

type WorkflowStep added in v1.2.0

type WorkflowStep struct {
	// Name is the unique name of the workflow step.
	Name        string             `json:"name"`
	Alias       string             `json:"alias"`
	Type        string             `json:"type"`
	Description string             `json:"description"`
	OrderIndex  int                `json:"orderIndex"`
	Inputs      common.StepInputs  `json:"inputs,omitempty"`
	Outputs     common.StepOutputs `json:"outputs,omitempty"`
	DependsOn   []string           `json:"dependsOn"`
	Properties  *JSONStruct        `json:"properties,omitempty"`
}

WorkflowStep defines how to execute a workflow step.

type WorkflowStepStatus added in v1.2.0

type WorkflowStepStatus struct {
	ID               string                   `json:"id"`
	Name             string                   `json:"name"`
	Alias            string                   `json:"alias"`
	Type             string                   `json:"type,omitempty"`
	Phase            common.WorkflowStepPhase `json:"phase,omitempty"`
	Message          string                   `json:"message,omitempty"`
	Reason           string                   `json:"reason,omitempty"`
	FirstExecuteTime time.Time                `json:"firstExecuteTime,omitempty"`
	LastExecuteTime  time.Time                `json:"lastExecuteTime,omitempty"`
}

WorkflowStepStatus is the workflow step status database model

Jump to

Keyboard shortcuts

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