Documentation ¶
Index ¶
- func GetChartController() *chartserver.Controller
- func Init() error
- type BaseController
- func (b *BaseController) HasProjectPermission(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) (bool, error)
- func (b *BaseController) PopulateUserSession(u models.User)
- func (b *BaseController) Prepare()
- func (b *BaseController) RequireAuthenticated() bool
- func (b *BaseController) RequireProjectAccess(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) bool
- func (b *BaseController) SendPermissionError()
- func (b *BaseController) WriteJSONData(object interface{})
- func (b *BaseController) WriteYamlData(object interface{})
- type ChartLabelAPI
- type ChartRepositoryAPI
- func (cra *ChartRepositoryAPI) DeleteChart()
- func (cra *ChartRepositoryAPI) DeleteChartVersion()
- func (cra *ChartRepositoryAPI) DownloadChart()
- func (cra *ChartRepositoryAPI) GetChartVersion()
- func (cra *ChartRepositoryAPI) GetHealthStatus()
- func (cra *ChartRepositoryAPI) GetIndex()
- func (cra *ChartRepositoryAPI) GetIndexByRepo()
- func (cra *ChartRepositoryAPI) ListChartVersions()
- func (cra *ChartRepositoryAPI) ListCharts()
- func (cra *ChartRepositoryAPI) Prepare()
- func (cra *ChartRepositoryAPI) UploadChartProvFile()
- func (cra *ChartRepositoryAPI) UploadChartVersion()
- type EmailAPI
- type InternalAPI
- type LabelResourceAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChartController ¶
func GetChartController() *chartserver.Controller
GetChartController returns the chart controller
Types ¶
type BaseController ¶
type BaseController struct { api.BaseAPI // SecurityCtx is the security context used to authN &authZ SecurityCtx security.Context // ProjectCtl is the project controller which abstracts the operations // related to projects ProjectCtl projectcontroller.Controller }
BaseController ...
func (*BaseController) HasProjectPermission ¶
func (b *BaseController) HasProjectPermission(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) (bool, error)
HasProjectPermission returns true when the request has action permission on project subresource
func (*BaseController) PopulateUserSession ¶
func (b *BaseController) PopulateUserSession(u models.User)
PopulateUserSession generates a new session ID and fill the user model in parm to the session
func (*BaseController) Prepare ¶
func (b *BaseController) Prepare()
Prepare inits security context and project manager from request context
func (*BaseController) RequireAuthenticated ¶
func (b *BaseController) RequireAuthenticated() bool
RequireAuthenticated returns true when the request is authenticated otherwise send Unauthorized response and returns false
func (*BaseController) RequireProjectAccess ¶
func (b *BaseController) RequireProjectAccess(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) bool
RequireProjectAccess returns true when the request has action access on project subresource otherwise send UnAuthorized or Forbidden response and returns false
func (*BaseController) SendPermissionError ¶
func (b *BaseController) SendPermissionError()
SendPermissionError is a shortcut for sending different http error based on authentication status.
func (*BaseController) WriteJSONData ¶
func (b *BaseController) WriteJSONData(object interface{})
WriteJSONData writes the JSON data to the client.
func (*BaseController) WriteYamlData ¶
func (b *BaseController) WriteYamlData(object interface{})
WriteYamlData writes the yaml data to the client.
type ChartLabelAPI ¶
type ChartLabelAPI struct { LabelResourceAPI // contains filtered or unexported fields }
ChartLabelAPI handles the requests of marking/removing labels to/from charts.
func (*ChartLabelAPI) GetLabels ¶
func (cla *ChartLabelAPI) GetLabels()
GetLabels gets labels for the specified chart version.
func (*ChartLabelAPI) MarkLabel ¶
func (cla *ChartLabelAPI) MarkLabel()
MarkLabel handles the request of marking label to chart.
func (*ChartLabelAPI) Prepare ¶
func (cla *ChartLabelAPI) Prepare()
Prepare required material for follow-up actions.
func (*ChartLabelAPI) RemoveLabel ¶
func (cla *ChartLabelAPI) RemoveLabel()
RemoveLabel handles the request of removing label from chart.
type ChartRepositoryAPI ¶
type ChartRepositoryAPI struct { // The base controller to provide common utilities BaseController // contains filtered or unexported fields }
ChartRepositoryAPI provides related API handlers for the chart repository APIs
func (*ChartRepositoryAPI) DeleteChart ¶
func (cra *ChartRepositoryAPI) DeleteChart()
DeleteChart deletes all the chart versions of the specified chart.
func (*ChartRepositoryAPI) DeleteChartVersion ¶
func (cra *ChartRepositoryAPI) DeleteChartVersion()
DeleteChartVersion handles DELETE /api/:repo/charts/:name/:version
func (*ChartRepositoryAPI) DownloadChart ¶
func (cra *ChartRepositoryAPI) DownloadChart()
DownloadChart handles GET /:repo/charts/:filename
func (*ChartRepositoryAPI) GetChartVersion ¶
func (cra *ChartRepositoryAPI) GetChartVersion()
GetChartVersion handles GET /api/:repo/charts/:name/:version
func (*ChartRepositoryAPI) GetHealthStatus ¶
func (cra *ChartRepositoryAPI) GetHealthStatus()
GetHealthStatus handles GET /api/chartrepo/health
func (*ChartRepositoryAPI) GetIndex ¶
func (cra *ChartRepositoryAPI) GetIndex()
GetIndex handles GET /index.yaml
func (*ChartRepositoryAPI) GetIndexByRepo ¶
func (cra *ChartRepositoryAPI) GetIndexByRepo()
GetIndexByRepo handles GET /:repo/index.yaml
func (*ChartRepositoryAPI) ListChartVersions ¶
func (cra *ChartRepositoryAPI) ListChartVersions()
ListChartVersions GET /api/:repo/charts/:name
func (*ChartRepositoryAPI) ListCharts ¶
func (cra *ChartRepositoryAPI) ListCharts()
ListCharts handles GET /api/:repo/charts
func (*ChartRepositoryAPI) Prepare ¶
func (cra *ChartRepositoryAPI) Prepare()
Prepare something for the following actions
func (*ChartRepositoryAPI) UploadChartProvFile ¶
func (cra *ChartRepositoryAPI) UploadChartProvFile()
UploadChartProvFile handles POST /api/:repo/prov
func (*ChartRepositoryAPI) UploadChartVersion ¶
func (cra *ChartRepositoryAPI) UploadChartVersion()
UploadChartVersion handles POST /api/:repo/charts
type EmailAPI ¶
type EmailAPI struct {
BaseController
}
EmailAPI ...
type InternalAPI ¶
type InternalAPI struct {
BaseController
}
InternalAPI handles request of harbor admin...
func (*InternalAPI) RenameAdmin ¶
func (ia *InternalAPI) RenameAdmin()
RenameAdmin we don't provide flexibility in this API, as this is a workaround.
type LabelResourceAPI ¶
type LabelResourceAPI struct { BaseController // contains filtered or unexported fields }
LabelResourceAPI provides the related basic functions to handle marking labels to resources
func (*LabelResourceAPI) Prepare ¶
func (lra *LabelResourceAPI) Prepare()
Prepare resources for follow-up actions.