Documentation ¶
Index ¶
- Constants
- Variables
- type Cluster
- func (e *Cluster) Delete() (bool, error)
- func (e *Cluster) DropTable()
- func (e *Cluster) Get() (Cluster, error)
- func (e *Cluster) GetList() ([]Cluster, error)
- func (e *Cluster) GetListAll(all bool) ([]Cluster, error)
- func (e *Cluster) HelmDelete() error
- func (e *Cluster) HelmInstall() error
- func (e *Cluster) HelmRollback() error
- func (e *Cluster) HelmUpgrade() error
- func (e *Cluster) InitTable() error
- func (e *Cluster) Insert() (id int, err error)
- func (e *Cluster) IsExisted(name, namespace string) bool
- func (e *Cluster) SetSpec(spec MapStringInterface) error
- func (e *Cluster) SetStatus(status ClusterStatus) error
- func (e *Cluster) SetValues(values string) error
- func (e *Cluster) Update(id int) (update Cluster, err error)
- func (e *Cluster) UpdateByUuid(uuid string) (update Cluster, err error)
- type ClusterArgs
- type ClusterStatus
- type Clusters
- type HelmChart
- func ChartRequestedToHelmChart(chartRequested *chart.Chart) (*HelmChart, error)
- func GetFateChart(chartName, chartVersion string) (*HelmChart, error)
- func HelmChartDownload(chartName, chartVersion string) (*HelmChart, error)
- func NewHelmChart(name string, chart string, values string, templates []*chart.File, ...) *HelmChart
- func (e *HelmChart) ChartRequestedToHelmChart(chartRequested *chart.Chart) (*HelmChart, error)
- func (e *HelmChart) ConvertToChart() (*chart.Chart, error)
- func (e *HelmChart) Delete(id int) (success bool, err error)
- func (e *HelmChart) DeleteByUuid(Uuid string) (success bool, err error)
- func (e *HelmChart) DropTable()
- func (e *HelmChart) Get() (HelmChart, error)
- func (e *HelmChart) GetChartValues(v map[string]interface{}) (map[string]interface{}, error)
- func (e *HelmChart) GetChartValuesTemplates() (string, error)
- func (e *HelmChart) GetList() ([]HelmChart, error)
- func (e *HelmChart) InitTable() error
- func (e *HelmChart) Insert() (id int, err error)
- func (e *HelmChart) IsExisted() bool
- func (e *HelmChart) ToHelmChart() (*chart.Chart, error)
- func (e *HelmChart) Update(id int) (update HelmChart, err error)
- func (e *HelmChart) Upload() (err error)
- type HelmCharts
- type Job
- func (e *Job) Delete() (bool, error)
- func (e *Job) DeleteById(id uint) (success bool, err error)
- func (e *Job) DropTable()
- func (e *Job) Get() (Job, error)
- func (e *Job) GetList() ([]Job, error)
- func (e *Job) InitTable() error
- func (e *Job) Insert() (id int, err error)
- func (e *Job) IsExisted(uuid string) bool
- func (e *Job) IsRunning() bool
- func (e *Job) IsStop() bool
- func (e *Job) SetState(State string) error
- func (e *Job) SetStates(States States) error
- func (e *Job) SetStatus(status JobStatus) error
- func (e *Job) SetSubJobs(subJobs SubJobs) error
- func (e *Job) TimeOut() bool
- func (e *Job) Update(id int) (update Job, err error)
- func (e *Job) UpdateByUuid(uuid string) (update Job, err error)
- type JobStatus
- type Jobs
- type MapStringInterface
- type Method
- type Namespace
- type Namespaces
- type States
- type SubJob
- type SubJobs
- type Templates
- type User
- func (e *User) Delete() (success bool, err error)
- func (e *User) DeleteById(id uint) (success bool, err error)
- func (e *User) DropTable()
- func (e *User) Encrypt()
- func (e *User) Get() (User, error)
- func (e *User) GetList() ([]User, error)
- func (e *User) InitTable() error
- func (e *User) Insert() (id int, err error)
- func (e *User) IsExisted() bool
- func (e *User) IsValid() bool
- func (e *User) Update(id uint) (update User, err error)
- type UserStatus
- type Users
Constants ¶
View Source
const ( MethodClusterInstall string = "ClusterInstall" UNINSTALL UPGRADE EXEC )
Variables ¶
View Source
var DB = orm.DB
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { // UUID is created by github.com/satori/go A combination of 36 bit strings generated by. UUID Uuid string `json:"uuid" gorm:"type:varchar(36);index;unique"` Name string `json:"name" gorm:"type:varchar(255);not null"` NameSpace string `json:"namespaces" gorm:"type:varchar(255);not null"` ChartName string `json:"chart_name" gorm:"type:varchar(255)"` ChartVersion string `json:"chart_version" gorm:"type:varchar(255);not null"` //Values field storage cluster.yaml File content of Values string `json:"values" gorm:"type:text"` //Spec corresponding to values(of Cluster) is decoded into interface by yaml Spec MapStringInterface `json:"Spec,omitempty" gorm:"type:blob"` // Cluster revision Revision int8 `json:"revision" gorm:"size:8"` // Cluster revision of helm HelmRevision int8 `json:"helm_revision" gorm:"size:8"` //Values through the values in the Chart file- template.yaml The file generates the corresponding helm values file ChartValues MapStringInterface `json:"chart_values" gorm:"type:blob"` //The status of the Cluster, including: "Creating","Deleting","Updating","Running","Unavailable","Deleted" Status ClusterStatus `json:"status" gorm:"size:8"` //Info is the corresponding information of Cluster in k8s Info MapStringInterface `json:"Info,omitempty" gorm:"type:blob"` gorm.Model }
func NewCluster ¶
NewCluster create Cluster object with basic argument
func (*Cluster) HelmDelete ¶
func (*Cluster) HelmInstall ¶
func (*Cluster) HelmRollback ¶
func (*Cluster) HelmUpgrade ¶
func (*Cluster) SetSpec ¶
func (e *Cluster) SetSpec(spec MapStringInterface) error
func (*Cluster) SetStatus ¶
func (e *Cluster) SetStatus(status ClusterStatus) error
type ClusterArgs ¶
type ClusterStatus ¶
type ClusterStatus int8
const ( ClusterStatusPending ClusterStatus = iota + 1 ClusterStatusCreating ClusterStatusDeleting ClusterStatusUpdating ClusterStatusRunning ClusterStatusDeleted ClusterStatusRollback ClusterStatusFailed ClusterStatusUnknown )
func (*ClusterStatus) MarshalJSON ¶
func (s *ClusterStatus) MarshalJSON() ([]byte, error)
MarshalJSON convert Cluster status to string
func (ClusterStatus) String ¶
func (s ClusterStatus) String() string
func (*ClusterStatus) UnmarshalJSON ¶
func (s *ClusterStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON sets *m to a copy of data.
type HelmChart ¶
type HelmChart struct { Uuid string `json:"uuid" gorm:"type:varchar(36);index;unique"` Name string `json:"name" gorm:"type:varchar(36);not null"` Chart string `json:"chart" gorm:"type:text;not null"` Values string `json:"values" gorm:"type:text;not null"` ValuesTemplate string `json:"values_template" gorm:"type:text;not null"` ValuesTemplateExample string `json:"values_template_example" gorm:"type:text;not null"` Templates Templates `json:"templates" gorm:"type:mediumblob" swaggerignore:"true"` Version string `json:"version" gorm:"type:varchar(32);not null"` AppVersion string `json:"app_version" gorm:"type:varchar(32);not null"` gorm.Model }
HelmChart Helm Chart model
func GetFateChart ¶
func HelmChartDownload ¶
func NewHelmChart ¶
func NewHelmChart(name string, chart string, values string, templates []*chart.File, version, appVersion string) *HelmChart
NewHelmChart create a new Helm Chart
func (*HelmChart) ChartRequestedToHelmChart ¶
func (*HelmChart) DeleteByUuid ¶
func (*HelmChart) GetChartValues ¶
func (*HelmChart) GetChartValuesTemplates ¶
type HelmCharts ¶
type HelmCharts []HelmChart
type Job ¶
type Job struct { Uuid string `json:"uuid" gorm:"type:varchar(36);index;unique"` StartTime time.Time `json:"start_time" gorm:"default:Null"` EndTime time.Time `json:"end_time" gorm:"default:Null"` Method string `json:"method" gorm:"type:varchar(16);not null"` ClusterId string `json:"cluster_id" gorm:"type:varchar(36)"` Creator string `json:"creator" gorm:"type:varchar(16);not null"` SubJobs SubJobs `json:"sub_jobs" gorm:"type:blob"` Status JobStatus `json:"status" gorm:"size:8"` TimeLimit time.Duration `json:"time_limit" swaggertype:"string"` Metadata *ClusterArgs `json:"meta_data" gorm:"embedded;embeddedPrefix:args_"` States States `json:"states" gorm:"type:text"` gorm.Model }
func NewJob ¶
func NewJob(metadata *ClusterArgs, method, creator, clusterUuid string) *Job
func (*Job) SetSubJobs ¶
type JobStatus ¶
type JobStatus int8
func (JobStatus) MarshalJSON ¶
func (*JobStatus) UnmarshalJSON ¶
UnmarshalJSON sets *m to a copy of data.
type MapStringInterface ¶
type MapStringInterface map[string]interface{}
func (*MapStringInterface) Scan ¶
func (s *MapStringInterface) Scan(v interface{}) error
type Namespace ¶
type Namespace struct { Name string Status string Labels map[string]string Annotations map[string]string Age string }
func (*Namespace) GetList ¶
func (e *Namespace) GetList() (Namespaces, error)
type Namespaces ¶
type Namespaces []Namespace
type User ¶
type User struct { Uuid string `json:"uuid,omitempty" gorm:"type:varchar(36);index;unique"` Username string `json:"username,omitempty" gorm:"index;unique;not null"` Password string `json:"password,omitempty" gorm:"type:varchar(512);not null"` Salt string `json:"salt,omitempty" gorm:"type:varchar(128);not null"` Email string `json:"email,omitempty" gorm:"type:varchar(255)"` Status UserStatus `json:"userStatus,omitempty" gorm:"size:8;not null"` gorm.Model }
type UserStatus ¶
type UserStatus int8
const ( Deprecate_u UserStatus = iota + 1 Available_u )
func (UserStatus) MarshalJSON ¶
func (s UserStatus) MarshalJSON() ([]byte, error)
func (UserStatus) String ¶
func (s UserStatus) String() string
func (*UserStatus) UnmarshalJSON ¶
func (s *UserStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON sets *m to a copy of data.
Click to show internal directories.
Click to hide internal directories.