-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Add v2.InternalAPISet
that implements the v2.KeptnInterface
#487
Conversation
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
Signed-off-by: Arthur Pitman <[email protected]>
SonarCloud Quality Gate failed.
|
type InternalService int | ||
|
||
const ( | ||
ConfigurationService InternalService = iota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported const ConfigurationService should have comment (or a comment on this block) or be unexported
const ( | ||
ConfigurationService InternalService = iota | ||
ShipyardController | ||
ApiService |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
const ApiService should be APIService
// (unauthenticated) internal calls to the api-service at the moment. So this implementation | ||
// will panic as soon as a client wants to call these methods | ||
type InternalAPIHandler struct { | ||
shipyardControllerApiHandler *APIHandler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
struct field shipyardControllerApiHandler should be shipyardControllerAPIHandler
shipyardControllerApiHandler *APIHandler | ||
} | ||
|
||
func (i *InternalAPIHandler) SendEvent(_ context.Context, event models.KeptnContextExtendedCE, _ APISendEventOptions) (*models.EventContext, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.SendEvent should have comment or be unexported
panic("SendEvent() is not not supported for internal usage") | ||
} | ||
|
||
func (i *InternalAPIHandler) TriggerEvaluation(ctx context.Context, project string, stage string, service string, evaluation models.Evaluation, opts APITriggerEvaluationOptions) (*models.EventContext, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.TriggerEvaluation should have comment or be unexported
return i.shipyardControllerApiHandler.CreateProject(ctx, project, opts) | ||
} | ||
|
||
func (i *InternalAPIHandler) UpdateProject(ctx context.Context, project models.CreateProject, opts APIUpdateProjectOptions) (string, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.UpdateProject should have comment or be unexported
return i.shipyardControllerApiHandler.UpdateProject(ctx, project, opts) | ||
} | ||
|
||
func (i *InternalAPIHandler) DeleteProject(ctx context.Context, project models.Project, opts APIDeleteProjectOptions) (*models.DeleteProjectResponse, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.DeleteProject should have comment or be unexported
return i.shipyardControllerApiHandler.DeleteProject(ctx, project, opts) | ||
} | ||
|
||
func (i *InternalAPIHandler) CreateService(ctx context.Context, project string, service models.CreateService, opts APICreateServiceOptions) (string, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.CreateService should have comment or be unexported
return i.shipyardControllerApiHandler.CreateService(ctx, project, service, opts) | ||
} | ||
|
||
func (i *InternalAPIHandler) DeleteService(ctx context.Context, project string, service string, opts APIDeleteServiceOptions) (*models.DeleteServiceResponse, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.DeleteService should have comment or be unexported
return i.shipyardControllerApiHandler.DeleteService(ctx, project, service, opts) | ||
} | ||
|
||
func (i *InternalAPIHandler) GetMetadata(_ context.Context, _ APIGetMetadataOptions) (*models.Metadata, *models.Error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint] reported by reviewdog 🐶
exported method InternalAPIHandler.GetMetadata should have comment or be unexported
This PR
v2.InternalAPISet
that implements thev2.KeptnInterface
api.InternalAPISet
is constructed correctly by usingapi.NewAPIHandlerWithHTTPClient
etc.