Documentation ¶
Index ¶
- type Option
- func WithBundle(bundle *bundle.Bundle) Option
- func WithCMP(cmpServer dashboardPb.ClusterResourceServer) Option
- func WithClusterSvc(clusterSvc clusterpb.ClusterServiceServer) Option
- func WithNamespace(ns *namespace.Namespace) Option
- func WithOrg(org org.Interface) Option
- func WithTokenSvc(tokenService tokenpb.TokenServiceServer) Option
- func WithTrans(translator i18n.Translator) Option
- type PackageContext
- type PackageDB
- func (t *PackageDB) GetContext() *PackageContext
- func (t *PackageDB) GetPackageName() string
- func (t *PackageDB) GetProjectPackage() *apistructs.ProjectPackage
- func (t *PackageDB) GetTempDir() string
- func (t *PackageDB) InitData()
- func (t *PackageDB) SetMeta() error
- func (t *PackageDB) SetProject() error
- type PackageDataCreator
- type PackageDataDirector
- func (t *PackageDataDirector) CheckPackage() error
- func (t *PackageDataDirector) Construct() error
- func (t *PackageDataDirector) GenAndUploadZipPackage() (string, error)
- func (t *PackageDataDirector) GenDesc() string
- func (t *PackageDataDirector) GenErrInfo() error
- func (t *PackageDataDirector) New(creator PackageDataCreator, bdl *bundle.Bundle, namespace *namespace.Namespace, ...)
- func (t *PackageDataDirector) TryInitProjectByPackage() error
- type PackageZip
- func (t *PackageZip) GetContext() *PackageContext
- func (t *PackageZip) GetPackageName() string
- func (t *PackageZip) GetProjectPackage() *apistructs.ProjectPackage
- func (t *PackageZip) GetTempDir() string
- func (t *PackageZip) InitData()
- func (t *PackageZip) SetMeta() error
- func (t *PackageZip) SetProject() error
- type Project
- func (p *Project) ApplicationsResources(ctx context.Context, req *apistructs.ApplicationsResourcesRequest) (*apistructs.ApplicationsResourcesResponse, *errorresp.APIError)
- func (p *Project) ExportPackage(req apistructs.ExportProjectPackageRequest) (uint64, error)
- func (p *Project) ExportProjectPackage(record *dao.TestFileRecord)
- func (p *Project) ExportTemplate(req apistructs.ExportProjectTemplateRequest) (uint64, error)
- func (p *Project) ExportTemplatePackage(record *dao.TestFileRecord)
- func (p *Project) Get(ctx context.Context, id uint64) (*apistructs.ProjectDTO, *errorresp.APIError)
- func (p *Project) ImportPackage(req apistructs.ImportProjectPackageRequest, r *http.Request) (uint64, error)
- func (p *Project) ImportProjectPackage(record *dao.TestFileRecord)
- func (p *Project) ImportTemplate(req apistructs.ImportProjectTemplateRequest, r *http.Request) (uint64, error)
- func (p *Project) ImportTemplatePackage(record *dao.TestFileRecord)
- func (p *Project) MakePackageName(origin string) string
- func (p *Project) MakeTemplatePackageName(origin string) string
- func (p *Project) ParsePackage(r io.ReadCloser) (*apistructs.ProjectPackage, error)
- func (p *Project) ParseTemplatePackage(r io.ReadCloser) (*apistructs.ProjectTemplateData, error)
- type TemplateDB
- func (t *TemplateDB) GetIdentityInfo() apistructs.IdentityInfo
- func (t *TemplateDB) GetPackageName() string
- func (t *TemplateDB) GetProjectID() uint64
- func (t *TemplateDB) GetProjectTemplate() *apistructs.ProjectTemplateData
- func (t *TemplateDB) InitData()
- func (t *TemplateDB) SetApplications() error
- func (t *TemplateDB) SetMeta() error
- type TemplateDataCreator
- type TemplateDataDirector
- func (t *TemplateDataDirector) CheckTemplatePackage() error
- func (t *TemplateDataDirector) Construct() error
- func (t *TemplateDataDirector) GenAndUploadZipPackage() (string, error)
- func (t *TemplateDataDirector) GenDesc() string
- func (t *TemplateDataDirector) GenErrInfo() error
- func (t *TemplateDataDirector) New(creator TemplateDataCreator, bdl *bundle.Bundle, ...)
- func (t *TemplateDataDirector) TryCreateAppsByTemplate() error
- type TemplateZip
- func (t *TemplateZip) GetIdentityInfo() apistructs.IdentityInfo
- func (t *TemplateZip) GetPackageName() string
- func (t *TemplateZip) GetProjectID() uint64
- func (t *TemplateZip) GetProjectTemplate() *apistructs.ProjectTemplateData
- func (t *TemplateZip) InitData()
- func (t *TemplateZip) SetApplications() error
- func (t *TemplateZip) SetMeta() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(project *Project)
Option the is fun to set *Project property
func WithBundle ¶
WithBundle sets the bundle to invoke other services
func WithCMP ¶
func WithCMP(cmpServer dashboardPb.ClusterResourceServer) Option
WithCMP sets the gRPC client to invoke CMP service Todo: the dependency on CMP will be moved to a service which is more suitable
func WithClusterSvc ¶
func WithClusterSvc(clusterSvc clusterpb.ClusterServiceServer) Option
func WithNamespace ¶
func WithTokenSvc ¶
func WithTokenSvc(tokenService tokenpb.TokenServiceServer) Option
func WithTrans ¶
func WithTrans(translator i18n.Translator) Option
WithTrans sets the translator for i18n
type PackageContext ¶
type PackageContext struct { ProjectID uint64 `json:"projectID"` ProjectName string `json:"projectName"` OrgID uint64 `json:"orgID"` OrgName string `json:"orgName"` apistructs.IdentityInfo }
type PackageDB ¶
type PackageDB struct { Artifacts []apistructs.Artifact `json:"artifacts"` Package *apistructs.ProjectPackage TempDir string // contains filtered or unexported fields }
func (*PackageDB) GetContext ¶
func (t *PackageDB) GetContext() *PackageContext
func (*PackageDB) GetPackageName ¶
func (*PackageDB) GetProjectPackage ¶
func (t *PackageDB) GetProjectPackage() *apistructs.ProjectPackage
func (*PackageDB) GetTempDir ¶
func (*PackageDB) SetProject ¶
type PackageDataCreator ¶
type PackageDataCreator interface { GetPackageName() string InitData() SetProject() error SetMeta() error GetProjectPackage() *apistructs.ProjectPackage GetTempDir() string GetContext() *PackageContext }
type PackageDataDirector ¶
type PackageDataDirector struct { Creator PackageDataCreator // contains filtered or unexported fields }
func (*PackageDataDirector) CheckPackage ¶
func (t *PackageDataDirector) CheckPackage() error
func (*PackageDataDirector) Construct ¶
func (t *PackageDataDirector) Construct() error
func (*PackageDataDirector) GenAndUploadZipPackage ¶
func (t *PackageDataDirector) GenAndUploadZipPackage() (string, error)
func (*PackageDataDirector) GenDesc ¶
func (t *PackageDataDirector) GenDesc() string
func (*PackageDataDirector) GenErrInfo ¶
func (t *PackageDataDirector) GenErrInfo() error
func (*PackageDataDirector) New ¶
func (t *PackageDataDirector) New(creator PackageDataCreator, bdl *bundle.Bundle, namespace *namespace.Namespace, tokenSvc tokenpb.TokenServiceServer, clusterSvc clusterpb.ClusterServiceServer)
func (*PackageDataDirector) TryInitProjectByPackage ¶
func (t *PackageDataDirector) TryInitProjectByPackage() error
type PackageZip ¶
type PackageZip struct { ProjectPackage *apistructs.ProjectPackage TmpDir string // contains filtered or unexported fields }
func (*PackageZip) GetContext ¶
func (t *PackageZip) GetContext() *PackageContext
func (*PackageZip) GetPackageName ¶
func (t *PackageZip) GetPackageName() string
func (*PackageZip) GetProjectPackage ¶
func (t *PackageZip) GetProjectPackage() *apistructs.ProjectPackage
func (*PackageZip) GetTempDir ¶
func (t *PackageZip) GetTempDir() string
func (*PackageZip) InitData ¶
func (t *PackageZip) InitData()
func (*PackageZip) SetMeta ¶
func (t *PackageZip) SetMeta() error
func (*PackageZip) SetProject ¶
func (t *PackageZip) SetProject() error
type Project ¶
type Project struct { CreateFileRecord func(req apistructs.TestFileRecordRequest) (uint64, error) UpdateFileRecord func(req apistructs.TestFileRecordRequest) error // contains filtered or unexported fields }
func (*Project) ApplicationsResources ¶
func (p *Project) ApplicationsResources(ctx context.Context, req *apistructs.ApplicationsResourcesRequest) ( *apistructs.ApplicationsResourcesResponse, *errorresp.APIError)
func (*Project) ExportPackage ¶
func (p *Project) ExportPackage(req apistructs.ExportProjectPackageRequest) (uint64, error)
func (*Project) ExportProjectPackage ¶
func (p *Project) ExportProjectPackage(record *dao.TestFileRecord)
func (*Project) ExportTemplate ¶
func (p *Project) ExportTemplate(req apistructs.ExportProjectTemplateRequest) (uint64, error)
func (*Project) ExportTemplatePackage ¶
func (p *Project) ExportTemplatePackage(record *dao.TestFileRecord)
func (*Project) Get ¶
func (p *Project) Get(ctx context.Context, id uint64) (*apistructs.ProjectDTO, *errorresp.APIError)
Get gets the project info. id is the project id.
func (*Project) ImportPackage ¶
func (p *Project) ImportPackage(req apistructs.ImportProjectPackageRequest, r *http.Request) (uint64, error)
func (*Project) ImportProjectPackage ¶
func (p *Project) ImportProjectPackage(record *dao.TestFileRecord)
func (*Project) ImportTemplate ¶
func (p *Project) ImportTemplate(req apistructs.ImportProjectTemplateRequest, r *http.Request) (uint64, error)
func (*Project) ImportTemplatePackage ¶
func (p *Project) ImportTemplatePackage(record *dao.TestFileRecord)
func (*Project) MakePackageName ¶
func (*Project) MakeTemplatePackageName ¶
func (*Project) ParsePackage ¶
func (p *Project) ParsePackage(r io.ReadCloser) (*apistructs.ProjectPackage, error)
func (*Project) ParseTemplatePackage ¶
func (p *Project) ParseTemplatePackage(r io.ReadCloser) (*apistructs.ProjectTemplateData, error)
type TemplateDB ¶
type TemplateDB struct { ProjectID uint64 `json:"projectID"` ProjectName string `json:"projectName"` OrgID int64 `json:"orgID"` Data *apistructs.ProjectTemplateData apistructs.IdentityInfo // contains filtered or unexported fields }
func (*TemplateDB) GetIdentityInfo ¶
func (t *TemplateDB) GetIdentityInfo() apistructs.IdentityInfo
func (*TemplateDB) GetPackageName ¶
func (t *TemplateDB) GetPackageName() string
func (*TemplateDB) GetProjectID ¶
func (t *TemplateDB) GetProjectID() uint64
func (*TemplateDB) GetProjectTemplate ¶
func (t *TemplateDB) GetProjectTemplate() *apistructs.ProjectTemplateData
func (*TemplateDB) InitData ¶
func (t *TemplateDB) InitData()
func (*TemplateDB) SetApplications ¶
func (t *TemplateDB) SetApplications() error
func (*TemplateDB) SetMeta ¶
func (t *TemplateDB) SetMeta() error
type TemplateDataCreator ¶
type TemplateDataCreator interface { GetPackageName() string InitData() SetApplications() error SetMeta() error GetProjectTemplate() *apistructs.ProjectTemplateData GetProjectID() uint64 GetIdentityInfo() apistructs.IdentityInfo }
type TemplateDataDirector ¶
type TemplateDataDirector struct { Creator TemplateDataCreator // contains filtered or unexported fields }
func (*TemplateDataDirector) CheckTemplatePackage ¶
func (t *TemplateDataDirector) CheckTemplatePackage() error
func (*TemplateDataDirector) Construct ¶
func (t *TemplateDataDirector) Construct() error
func (*TemplateDataDirector) GenAndUploadZipPackage ¶
func (t *TemplateDataDirector) GenAndUploadZipPackage() (string, error)
func (*TemplateDataDirector) GenDesc ¶
func (t *TemplateDataDirector) GenDesc() string
func (*TemplateDataDirector) GenErrInfo ¶
func (t *TemplateDataDirector) GenErrInfo() error
func (*TemplateDataDirector) New ¶
func (t *TemplateDataDirector) New(creator TemplateDataCreator, bdl *bundle.Bundle, namespace *namespace.Namespace)
func (*TemplateDataDirector) TryCreateAppsByTemplate ¶
func (t *TemplateDataDirector) TryCreateAppsByTemplate() error
type TemplateZip ¶
type TemplateZip struct { ProjectID uint64 `json:"projectID"` ProjectName string `json:"projectName"` OrgID int64 `json:"orgID"` Data *apistructs.ProjectTemplateData apistructs.IdentityInfo // contains filtered or unexported fields }
func (*TemplateZip) GetIdentityInfo ¶
func (t *TemplateZip) GetIdentityInfo() apistructs.IdentityInfo
func (*TemplateZip) GetPackageName ¶
func (t *TemplateZip) GetPackageName() string
func (*TemplateZip) GetProjectID ¶
func (t *TemplateZip) GetProjectID() uint64
func (*TemplateZip) GetProjectTemplate ¶
func (t *TemplateZip) GetProjectTemplate() *apistructs.ProjectTemplateData
func (*TemplateZip) InitData ¶
func (t *TemplateZip) InitData()
func (*TemplateZip) SetApplications ¶
func (t *TemplateZip) SetApplications() error
func (*TemplateZip) SetMeta ¶
func (t *TemplateZip) SetMeta() error
Click to show internal directories.
Click to hide internal directories.