Documentation
¶
Index ¶
- type HarborAPI
- func (o *HarborAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *HarborAPI) Authorizer() runtime.Authorizer
- func (o *HarborAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *HarborAPI) Context() *middleware.Context
- func (o *HarborAPI) DefaultConsumes() string
- func (o *HarborAPI) DefaultProduces() string
- func (o *HarborAPI) Formats() strfmt.Registry
- func (o *HarborAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *HarborAPI) Init()
- func (o *HarborAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *HarborAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *HarborAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *HarborAPI) RegisterMiddleware(operation string, builder middleware.Builder)
- func (o *HarborAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *HarborAPI) Serve(builder middleware.Builder) http.Handler
- func (o *HarborAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *HarborAPI) SetDefaultConsumes(mediaType string)
- func (o *HarborAPI) SetDefaultProduces(mediaType string)
- func (o *HarborAPI) SetSpec(spec *loads.Document)
- func (o *HarborAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HarborAPI ¶
type HarborAPI struct {
Middleware func(middleware.Builder) http.Handler
// BeforePrepare is called before the Prepare of the operation
BeforePrepare func(context.Context, string, interface{}) middleware.Responder
// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
// JSONConsumer registers a consumer for a "application/json" mime type
JSONConsumer runtime.Consumer
// JSONProducer registers a producer for a "application/json" mime type
JSONProducer runtime.Producer
// BinProducer registers a producer for a "application/octet-stream" mime type
BinProducer runtime.Producer
// TxtProducer registers a producer for a "text/plain" mime type
TxtProducer runtime.Producer
// BasicAuth registers a function that takes username and password and returns a principal
// it performs authentication with basic auth
BasicAuth func(string, string) (interface{}, error)
// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
APIAuthorizer runtime.Authorizer
// ArtifactCopyArtifactHandler sets the operation handler for the copy artifact operation
ArtifactCopyArtifactHandler artifact.CopyArtifactHandler
// PreheatCreateInstanceHandler sets the operation handler for the create instance operation
PreheatCreateInstanceHandler preheat.CreateInstanceHandler
// PreheatCreatePolicyHandler sets the operation handler for the create policy operation
PreheatCreatePolicyHandler preheat.CreatePolicyHandler
// RobotCreateRobotHandler sets the operation handler for the create robot operation
RobotCreateRobotHandler robot.CreateRobotHandler
// Robotv1CreateRobotV1Handler sets the operation handler for the create robot v1 operation
Robotv1CreateRobotV1Handler robotv1.CreateRobotV1Handler
// PreheatDeleteInstanceHandler sets the operation handler for the delete instance operation
PreheatDeleteInstanceHandler preheat.DeleteInstanceHandler
// PreheatDeletePolicyHandler sets the operation handler for the delete policy operation
PreheatDeletePolicyHandler preheat.DeletePolicyHandler
// RobotDeleteRobotHandler sets the operation handler for the delete robot operation
RobotDeleteRobotHandler robot.DeleteRobotHandler
// Robotv1DeleteRobotV1Handler sets the operation handler for the delete robot v1 operation
Robotv1DeleteRobotV1Handler robotv1.DeleteRobotV1Handler
// PreheatGetExecutionHandler sets the operation handler for the get execution operation
PreheatGetExecutionHandler preheat.GetExecutionHandler
// PreheatGetInstanceHandler sets the operation handler for the get instance operation
PreheatGetInstanceHandler preheat.GetInstanceHandler
// PingGetPingHandler sets the operation handler for the get ping operation
PingGetPingHandler ping.GetPingHandler
// PreheatGetPolicyHandler sets the operation handler for the get policy operation
PreheatGetPolicyHandler preheat.GetPolicyHandler
// PreheatGetPreheatLogHandler sets the operation handler for the get preheat log operation
PreheatGetPreheatLogHandler preheat.GetPreheatLogHandler
// RobotGetRobotByIDHandler sets the operation handler for the get robot by ID operation
RobotGetRobotByIDHandler robot.GetRobotByIDHandler
// Robotv1GetRobotByIDV1Handler sets the operation handler for the get robot by ID v1 operation
Robotv1GetRobotByIDV1Handler robotv1.GetRobotByIDV1Handler
// SysteminfoGetSysteminfoHandler sets the operation handler for the get systeminfo operation
SysteminfoGetSysteminfoHandler systeminfo.GetSysteminfoHandler
// SysteminfoGetSysteminfoGetcertHandler sets the operation handler for the get systeminfo getcert operation
SysteminfoGetSysteminfoGetcertHandler systeminfo.GetSysteminfoGetcertHandler
// SysteminfoGetSysteminfoVolumesHandler sets the operation handler for the get systeminfo volumes operation
SysteminfoGetSysteminfoVolumesHandler systeminfo.GetSysteminfoVolumesHandler
// PreheatListExecutionsHandler sets the operation handler for the list executions operation
PreheatListExecutionsHandler preheat.ListExecutionsHandler
// PreheatListInstancesHandler sets the operation handler for the list instances operation
PreheatListInstancesHandler preheat.ListInstancesHandler
// PreheatListPoliciesHandler sets the operation handler for the list policies operation
PreheatListPoliciesHandler preheat.ListPoliciesHandler
// PreheatListProvidersHandler sets the operation handler for the list providers operation
PreheatListProvidersHandler preheat.ListProvidersHandler
// PreheatListProvidersUnderProjectHandler sets the operation handler for the list providers under project operation
PreheatListProvidersUnderProjectHandler preheat.ListProvidersUnderProjectHandler
// RobotListRobotHandler sets the operation handler for the list robot operation
RobotListRobotHandler robot.ListRobotHandler
// Robotv1ListRobotV1Handler sets the operation handler for the list robot v1 operation
Robotv1ListRobotV1Handler robotv1.ListRobotV1Handler
// PreheatListTasksHandler sets the operation handler for the list tasks operation
PreheatListTasksHandler preheat.ListTasksHandler
// PreheatManualPreheatHandler sets the operation handler for the manual preheat operation
PreheatManualPreheatHandler preheat.ManualPreheatHandler
// PreheatPingInstancesHandler sets the operation handler for the ping instances operation
PreheatPingInstancesHandler preheat.PingInstancesHandler
// RobotRefreshSecHandler sets the operation handler for the refresh sec operation
RobotRefreshSecHandler robot.RefreshSecHandler
// PreheatStopExecutionHandler sets the operation handler for the stop execution operation
PreheatStopExecutionHandler preheat.StopExecutionHandler
// PreheatUpdateInstanceHandler sets the operation handler for the update instance operation
PreheatUpdateInstanceHandler preheat.UpdateInstanceHandler
// PreheatUpdatePolicyHandler sets the operation handler for the update policy operation
PreheatUpdatePolicyHandler preheat.UpdatePolicyHandler
// RobotUpdateRobotHandler sets the operation handler for the update robot operation
RobotUpdateRobotHandler robot.UpdateRobotHandler
// Robotv1UpdateRobotV1Handler sets the operation handler for the update robot v1 operation
Robotv1UpdateRobotV1Handler robotv1.UpdateRobotV1Handler
// ArtifactAddLabelHandler sets the operation handler for the add label operation
ArtifactAddLabelHandler artifact.AddLabelHandler
// GCCreateGCScheduleHandler sets the operation handler for the create GC schedule operation
GCCreateGCScheduleHandler gc.CreateGCScheduleHandler
// ProjectCreateProjectHandler sets the operation handler for the create project operation
ProjectCreateProjectHandler project.CreateProjectHandler
// RetentionCreateRetentionHandler sets the operation handler for the create retention operation
RetentionCreateRetentionHandler retention.CreateRetentionHandler
// ScanAllCreateScanAllScheduleHandler sets the operation handler for the create scan all schedule operation
ScanAllCreateScanAllScheduleHandler scan_all.CreateScanAllScheduleHandler
// ArtifactCreateTagHandler sets the operation handler for the create tag operation
ArtifactCreateTagHandler artifact.CreateTagHandler
// ArtifactDeleteArtifactHandler sets the operation handler for the delete artifact operation
ArtifactDeleteArtifactHandler artifact.DeleteArtifactHandler
// ProjectDeleteProjectHandler sets the operation handler for the delete project operation
ProjectDeleteProjectHandler project.DeleteProjectHandler
// RepositoryDeleteRepositoryHandler sets the operation handler for the delete repository operation
RepositoryDeleteRepositoryHandler repository.DeleteRepositoryHandler
// ArtifactDeleteTagHandler sets the operation handler for the delete tag operation
ArtifactDeleteTagHandler artifact.DeleteTagHandler
// ArtifactGetAdditionHandler sets the operation handler for the get addition operation
ArtifactGetAdditionHandler artifact.GetAdditionHandler
// ArtifactGetArtifactHandler sets the operation handler for the get artifact operation
ArtifactGetArtifactHandler artifact.GetArtifactHandler
// GCGetGCHandler sets the operation handler for the get GC operation
GCGetGCHandler gc.GetGCHandler
// GCGetGCHistoryHandler sets the operation handler for the get GC history operation
GCGetGCHistoryHandler gc.GetGCHistoryHandler
// GCGetGCLogHandler sets the operation handler for the get GC log operation
GCGetGCLogHandler gc.GetGCLogHandler
// GCGetGCScheduleHandler sets the operation handler for the get GC schedule operation
GCGetGCScheduleHandler gc.GetGCScheduleHandler
// IconGetIconHandler sets the operation handler for the get icon operation
IconGetIconHandler icon.GetIconHandler
// ScanAllGetLatestScanAllMetricsHandler sets the operation handler for the get latest scan all metrics operation
ScanAllGetLatestScanAllMetricsHandler scan_all.GetLatestScanAllMetricsHandler
// ScanAllGetLatestScheduledScanAllMetricsHandler sets the operation handler for the get latest scheduled scan all metrics operation
ScanAllGetLatestScheduledScanAllMetricsHandler scan_all.GetLatestScheduledScanAllMetricsHandler
// ProjectGetLogsHandler sets the operation handler for the get logs operation
ProjectGetLogsHandler project.GetLogsHandler
// ProjectGetProjectHandler sets the operation handler for the get project operation
ProjectGetProjectHandler project.GetProjectHandler
// ProjectGetProjectDeletableHandler sets the operation handler for the get project deletable operation
ProjectGetProjectDeletableHandler project.GetProjectDeletableHandler
// ProjectGetProjectSummaryHandler sets the operation handler for the get project summary operation
ProjectGetProjectSummaryHandler project.GetProjectSummaryHandler
// RetentionGetRentenitionMetadataHandler sets the operation handler for the get rentenition metadata operation
RetentionGetRentenitionMetadataHandler retention.GetRentenitionMetadataHandler
// ReplicationGetReplicationExecutionHandler sets the operation handler for the get replication execution operation
ReplicationGetReplicationExecutionHandler replication.GetReplicationExecutionHandler
// ReplicationGetReplicationLogHandler sets the operation handler for the get replication log operation
ReplicationGetReplicationLogHandler replication.GetReplicationLogHandler
// ScanGetReportLogHandler sets the operation handler for the get report log operation
ScanGetReportLogHandler scan.GetReportLogHandler
// RepositoryGetRepositoryHandler sets the operation handler for the get repository operation
RepositoryGetRepositoryHandler repository.GetRepositoryHandler
// RetentionGetRetentionHandler sets the operation handler for the get retention operation
RetentionGetRetentionHandler retention.GetRetentionHandler
// RetentionGetRetentionTaskLogHandler sets the operation handler for the get retention task log operation
RetentionGetRetentionTaskLogHandler retention.GetRetentionTaskLogHandler
// ScanAllGetScanAllScheduleHandler sets the operation handler for the get scan all schedule operation
ScanAllGetScanAllScheduleHandler scan_all.GetScanAllScheduleHandler
// ArtifactGetVulnerabilitiesAdditionHandler sets the operation handler for the get vulnerabilities addition operation
ArtifactGetVulnerabilitiesAdditionHandler artifact.GetVulnerabilitiesAdditionHandler
// ProjectHeadProjectHandler sets the operation handler for the head project operation
ProjectHeadProjectHandler project.HeadProjectHandler
// ArtifactListArtifactsHandler sets the operation handler for the list artifacts operation
ArtifactListArtifactsHandler artifact.ListArtifactsHandler
// AuditlogListAuditLogsHandler sets the operation handler for the list audit logs operation
AuditlogListAuditLogsHandler auditlog.ListAuditLogsHandler
// ProjectListProjectsHandler sets the operation handler for the list projects operation
ProjectListProjectsHandler project.ListProjectsHandler
// ReplicationListReplicationExecutionsHandler sets the operation handler for the list replication executions operation
ReplicationListReplicationExecutionsHandler replication.ListReplicationExecutionsHandler
// ReplicationListReplicationTasksHandler sets the operation handler for the list replication tasks operation
ReplicationListReplicationTasksHandler replication.ListReplicationTasksHandler
// RepositoryListRepositoriesHandler sets the operation handler for the list repositories operation
RepositoryListRepositoriesHandler repository.ListRepositoriesHandler
// RetentionListRetentionExecutionsHandler sets the operation handler for the list retention executions operation
RetentionListRetentionExecutionsHandler retention.ListRetentionExecutionsHandler
// RetentionListRetentionTasksHandler sets the operation handler for the list retention tasks operation
RetentionListRetentionTasksHandler retention.ListRetentionTasksHandler
// ArtifactListTagsHandler sets the operation handler for the list tags operation
ArtifactListTagsHandler artifact.ListTagsHandler
// RetentionOperateRetentionExecutionHandler sets the operation handler for the operate retention execution operation
RetentionOperateRetentionExecutionHandler retention.OperateRetentionExecutionHandler
// ArtifactRemoveLabelHandler sets the operation handler for the remove label operation
ArtifactRemoveLabelHandler artifact.RemoveLabelHandler
// ScanScanArtifactHandler sets the operation handler for the scan artifact operation
ScanScanArtifactHandler scan.ScanArtifactHandler
// ReplicationStartReplicationHandler sets the operation handler for the start replication operation
ReplicationStartReplicationHandler replication.StartReplicationHandler
// ReplicationStopReplicationHandler sets the operation handler for the stop replication operation
ReplicationStopReplicationHandler replication.StopReplicationHandler
// RetentionTriggerRetentionExecutionHandler sets the operation handler for the trigger retention execution operation
RetentionTriggerRetentionExecutionHandler retention.TriggerRetentionExecutionHandler
// GCUpdateGCScheduleHandler sets the operation handler for the update GC schedule operation
GCUpdateGCScheduleHandler gc.UpdateGCScheduleHandler
// ProjectUpdateProjectHandler sets the operation handler for the update project operation
ProjectUpdateProjectHandler project.UpdateProjectHandler
// RepositoryUpdateRepositoryHandler sets the operation handler for the update repository operation
RepositoryUpdateRepositoryHandler repository.UpdateRepositoryHandler
// RetentionUpdateRetentionHandler sets the operation handler for the update retention operation
RetentionUpdateRetentionHandler retention.UpdateRetentionHandler
// ScanAllUpdateScanAllScheduleHandler sets the operation handler for the update scan all schedule operation
ScanAllUpdateScanAllScheduleHandler scan_all.UpdateScanAllScheduleHandler
// ServeError is called when an error is received, there is a default handler
// but you can set your own with this
ServeError func(http.ResponseWriter, *http.Request, error)
// ServerShutdown is called when the HTTP(S) server is shut down and done
// handling all active connections and does not accept connections any more
ServerShutdown func()
// Custom command line argument groups with their descriptions
CommandLineOptionsGroups []swag.CommandLineOptionsGroup
// User defined logger function.
Logger func(string, ...interface{})
// contains filtered or unexported fields
}
HarborAPI These APIs provide services for manipulating Harbor project.
func NewHarborAPI ¶
NewHarborAPI creates a new Harbor instance
func (*HarborAPI) AuthenticatorsFor ¶
func (o *HarborAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*HarborAPI) Authorizer ¶
func (o *HarborAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*HarborAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types
func (*HarborAPI) Context ¶
func (o *HarborAPI) Context() *middleware.Context
Context returns the middleware context for the harbor API
func (*HarborAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*HarborAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*HarborAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*HarborAPI) Init ¶
func (o *HarborAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*HarborAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types
func (*HarborAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*HarborAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*HarborAPI) RegisterMiddleware ¶
func (o *HarborAPI) RegisterMiddleware(operation string, builder middleware.Builder)
RegisterMiddleware allows you to add (or override) a middleware for operation.
func (*HarborAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*HarborAPI) Serve ¶
func (o *HarborAPI) Serve(builder middleware.Builder) http.Handler
Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
func (*HarborAPI) ServeErrorFor ¶
func (o *HarborAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*HarborAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*HarborAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type