project

package
v0.0.0-...-1ae172a Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppBaseService

type AppBaseService struct {
	// contains filtered or unexported fields
}

func NewAppBaseService

func NewAppBaseService(models *model.Models) *AppBaseService

func (*AppBaseService) ResolveChart

func (b *AppBaseService) ResolveChart(chartIn io.Reader) *utils.Response

type AppRuntimeStatus

type AppRuntimeStatus struct {
	Name          string                       `json:"name"`
	RuntimeStatus string                       `json:"runtime_status"`
	Objects       []*unstructured.Unstructured `json:"objects"`
	PodsNum       int                          `json:"pods_num"`
	ReadyPodsNum  int                          `json:"ready_pods_num"`
}

type AppService

type AppService struct {
	*AppBaseService
	// contains filtered or unexported fields
}

func NewAppService

func NewAppService(kubeClient *cluster.KubeClient, appBaseService *AppBaseService) *AppService

func (*AppService) CreateProjectApp

func (a *AppService) CreateProjectApp(form *CreateAppForm) (*types.App, error)

func (*AppService) DestroyApp

func (a *AppService) DestroyApp(appId uint, user string) (*types.App, error)

func (*AppService) DuplicateApp

func (a *AppService) DuplicateApp(ser *DuplicateAppForm) (*types.App, *types.AppVersion, error)

DuplicateApp 克隆应用到工作空间,或者发布到应用商店

func (*AppService) GetApp

func (a *AppService) GetApp(appId uint) *utils.Response

func (*AppService) GetAppChartFiles

func (a *AppService) GetAppChartFiles(appVersionId uint) (*types.App, *types.AppVersion, map[string]interface{}, error)

GetAppChartFiles 获取应用helm chart所有文件

func (*AppService) GetAppStatus

func (a *AppService) GetAppStatus(scope string, scopeId uint, name string) (map[string]*AppRuntimeStatus, error)

func (*AppService) GetAppVersion

func (a *AppService) GetAppVersion(appVersionId uint) *utils.Response

func (*AppService) GetReleaseObjects

func (a *AppService) GetReleaseObjects(release *release.Release) []*unstructured.Unstructured

func (*AppService) ImportCustomApp

func (a *AppService) ImportCustomApp(serializer *ImportCustomAppForm) (*types.App, *types.AppVersion, error)

ImportCustomApp 工作空间导入自定义应用

func (*AppService) ImportProjectApp

func (a *AppService) ImportProjectApp(
	originApp *types.App,
	version *types.AppVersion,
	destProjectId uint,
	destAppName string,
	user string) error

func (*AppService) ImportStoreApp

func (a *AppService) ImportStoreApp(importForm *ImportStoreAppForm) (*types.App, *types.AppVersion, error)

ImportStoreApp 从应用商店导入应用

func (*AppService) ImportToStore

func (a *AppService) ImportToStore(originApp *types.App, version *types.AppVersion, destAppName string, user string) error

ImportToStore 工作空间应用发布到应用商店

func (*AppService) InstallApp

func (a *AppService) InstallApp(installForm *InstallAppForm) (*types.App, *types.AppVersion, error)

func (*AppService) ListApp

func (a *AppService) ListApp(scope string, scopeId uint) ([]*types.App, error)

func (*AppService) WriteFile

func (a *AppService) WriteFile(fileName, content string) error

type AppStoreService

type AppStoreService struct {
	*AppBaseService
}

func NewAppStoreService

func NewAppStoreService(appBaseService *AppBaseService) *AppStoreService

func (*AppStoreService) CreateStoreApp

func (s *AppStoreService) CreateStoreApp(form *CreateStoreAppForm) (*types.AppStore, *types.AppVersion, error)

func (*AppStoreService) DeleteVersion

func (s *AppStoreService) DeleteVersion(appId, versionId uint, user string) *utils.Response

func (*AppStoreService) GetStoreApp

func (s *AppStoreService) GetStoreApp(appId uint, withVersions bool) *utils.Response

func (*AppStoreService) ListStoreApp

func (s *AppStoreService) ListStoreApp(withVersions bool) *utils.Response

type CreateAppForm

type CreateAppForm struct {
	Scope              string                 `json:"scope" form:"scope"`
	ScopeId            uint                   `json:"scope_id" form:"scope_id"`
	Name               string                 `json:"name" form:"name"`
	From               string                 `json:"from" form:"from"`
	Type               string                 `json:"type" form:"type"`
	Description        string                 `json:"description" form:"description"`
	VersionDescription string                 `json:"version_description" form:"version_description"`
	Version            string                 `json:"version" form:"version"`
	Values             string                 `json:"values" form:"values"`
	ChartFiles         map[string]interface{} `json:"chart_files"`
	User               string                 `json:"user"`
}

type CreateStoreAppForm

type CreateStoreAppForm struct {
	Name               string `json:"name" form:"name"`
	PackageVersion     string `json:"package_version" form:"package_version"`
	AppVersion         string `json:"app_version" form:"app_version"`
	Description        string `json:"description" form:"description"`
	VersionDescription string `json:"version_description" form:"version_description"`
	Type               string `json:"type" form:"type"`
	ChartBytes         []byte `json:"chart_bytes" form:"chart_bytes"`
	IconBytes          []byte `json:"icon_bytes" form:"icon_bytes"`
	User               string `json:"user" form:"user"`
}

type DuplicateAppForm

type DuplicateAppForm struct {
	Name      string `json:"name" form:"name"`
	AppId     uint   `json:"app_id" form:"app_id"`
	VersionId uint   `json:"version_id" form:"version_id"`
	Scope     string `json:"scope" form:"scope"`
	ScopeId   uint   `json:"scope_id" form:"scope_id"`
	User      string `json:"user" form:"user"`
}

type ImportCustomAppForm

type ImportCustomAppForm struct {
	Scope              string `json:"scope" form:"scope"`
	ScopeId            uint   `json:"scope_id" form:"scope_id"`
	Name               string `json:"name" form:"name"`
	PackageVersion     string `json:"package_version" form:"package_version"`
	AppVersion         string `json:"app_version" form:"app_version"`
	Description        string `json:"description" form:"description"`
	VersionDescription string `json:"version_description" form:"version_description"`
	Type               string `json:"type" form:"type"`
	ChartBytes         []byte `json:"chart_bytes" form:"chart_bytes"`
	User               string `json:"user" form:"user"`
}

type ImportStoreAppForm

type ImportStoreAppForm struct {
	Scope        string `json:"scope" form:"scope"`
	ScopeId      uint   `json:"scope_id" form:"scope_id"`
	Namespace    string `json:"namespace" form:"namespace"`
	StoreAppId   uint   `json:"store_app_id" form:"store_app_id"`
	AppVersionId uint   `json:"app_version_id" form:"app_version_id"`
	User         string `json:"user" form:"user"`
}

type InstallAppForm

type InstallAppForm struct {
	AppId        uint   `json:"app_id" form:"app_id"`
	Values       string `json:"values" form:"values"`
	AppVersionId uint   `json:"app_version_id" form:"app_version_id"`
	Upgrade      bool   `json:"upgrade" form:"upgrade"`
	User         string `json:"user" form:"user"`
}

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

func NewProjectService

func NewProjectService(models *model.Models, kubeClient *cluster.KubeClient, appService *AppService) *ProjectService

func (*ProjectService) Clone

func (p *ProjectService) Clone(sourceProjectId uint, newProject *types.Project) (*types.Project, error)

func (*ProjectService) Delete

func (p *ProjectService) Delete(projectId uint, delResource bool) (*types.Project, error)

func (*ProjectService) Get

func (p *ProjectService) Get(projectId uint, withDetail bool) *utils.Response

func (*ProjectService) GetProjectNamespaceResources

func (p *ProjectService) GetProjectNamespaceResources(projectId uint) *utils.Response

Jump to

Keyboard shortcuts

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