Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // ListV2 lists all template available ListV2(ctx context.Context, query *q.Query, withFullPath bool) (Templates, error) // ListTemplate list all template available ListTemplate(ctx context.Context) (Templates, error) // ListTemplateRelease list all releases of the specified template ListTemplateRelease(ctx context.Context, templateName string) (Releases, error) // GetTemplateSchema get schema for a template release GetTemplateSchema(ctx context.Context, releaseID uint, params map[string]string) (*Schemas, error) // ListTemplateByGroupID lists all template available by group ID ListTemplateByGroupID(ctx context.Context, groupID uint, withoutCI bool) (Templates, error) // ListTemplateReleaseByTemplateID lists all releases of the specified template ListTemplateReleaseByTemplateID(ctx context.Context, templateID uint) (Releases, error) // CreateTemplate creates a template with a release under a group CreateTemplate(ctx context.Context, groupID uint, request CreateTemplateRequest) (*Template, error) // CreateRelease downloads template archive and push it to chatmusuem, // then creates a template release in database. CreateRelease(ctx context.Context, templateID uint, request CreateReleaseRequest) (*Release, error) // GetTemplate gets template by templateID GetTemplate(ctx context.Context, templateID uint) (*Template, error) // GetRelease gets release by releaseID GetRelease(ctx context.Context, releaseID uint) (*Release, error) // DeleteTemplate deletes a template by ID DeleteTemplate(ctx context.Context, templateID uint) error // DeleteRelease deletes a template release by ID DeleteRelease(ctx context.Context, releaseID uint) error // UpdateTemplate deletes a template by ID UpdateTemplate(ctx context.Context, templateID uint, request UpdateTemplateRequest) error // UpdateRelease deletes a template release by ID UpdateRelease(ctx context.Context, releaseID uint, request UpdateReleaseRequest) error // SyncReleaseToRepo downloads template from gitlab, packages the template and uploads it to chart repo SyncReleaseToRepo(ctx context.Context, releaseID uint) error }
func NewController ¶
func NewController(param *param.Param, repo templaterepo.TemplateRepo) Controller
NewController initializes a new controller
type CreateReleaseRequest ¶
type CreateTemplateRequest ¶
type CreateTemplateRequest struct { // when creating template, user must create a release, // otherwise, it's a useless template. CreateReleaseRequest `json:"release"` Name string `json:"name"` Description string `json:"description"` Repository string `json:"repository"` Type string `json:"type"` OnlyOwner bool `json:"onlyOwner"` }
type Release ¶
type Release struct { ID uint `json:"id"` Name string `json:"name"` TemplateID uint `json:"templateID"` TemplateName string `json:"templateName"` ChartVersion string `json:"chartVersion"` Description string `json:"description"` Recommended bool `json:"recommended"` OnlyOwner bool `json:"onlyOwner"` CommitID string `json:"commitID"` SyncStatusCode uint8 `json:"syncStatusCode"` SyncStatus string `json:"syncStatus"` LastSyncAt time.Time `json:"lastSyncAt"` FailedReason string `json:"failedReason"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` CreatedBy uint `json:"createdBy"` UpdatedBy uint `json:"updatedBy"` }
type Template ¶
type Template struct { ID uint `json:"id"` Name string `json:"name"` ChartName string `json:"chartName"` Description string `json:"description"` Repository string `json:"repository"` Releases Releases `json:"releases,omitempty"` FullPath string `json:"fullPath,omitempty"` GroupID uint `json:"group"` OnlyOwner bool `json:"onlyOwner"` WithoutCI bool `json:"withoutCI"` Type string `json:"type"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` CreatedBy uint `json:"createdBy"` UpdatedBy uint `json:"updatedBy"` }
type UpdateReleaseRequest ¶
Click to show internal directories.
Click to hide internal directories.