Skip to content

Commit

Permalink
make format: Run format target to format
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Bana committed May 13, 2022
1 parent 923483a commit d0aebab
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 37 deletions.
16 changes: 8 additions & 8 deletions server/go/api_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

// ApisApiController binds http requests to an api service and writes the service results to the http response
type ApisApiController struct {
service ApisApiServicer
service ApisApiServicer
errorHandler ErrorHandler
}

Expand Down Expand Up @@ -49,7 +49,7 @@ func NewApisApiController(s ApisApiServicer, opts ...ApisApiOption) Router {

// Routes returns all of the api route for the ApisApiController
func (c *ApisApiController) Routes() Routes {
return Routes{
return Routes{
{
"DeployApi",
strings.ToUpper("Post"),
Expand Down Expand Up @@ -111,9 +111,9 @@ func (c *ApisApiController) DeployApi(w http.ResponseWriter, r *http.Request) {
func (c *ApisApiController) GetApi(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
namespaceParam := params["namespace"]

nameParam := params["name"]

result, err := c.service.GetApi(r.Context(), namespaceParam, nameParam)
// If an error occurred, encode the error with the status code
if err != nil {
Expand All @@ -129,9 +129,9 @@ func (c *ApisApiController) GetApi(w http.ResponseWriter, r *http.Request) {
func (c *ApisApiController) GetApiCRD(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
namespaceParam := params["namespace"]

nameParam := params["name"]

result, err := c.service.GetApiCRD(r.Context(), namespaceParam, nameParam)
// If an error occurred, encode the error with the status code
if err != nil {
Expand All @@ -147,9 +147,9 @@ func (c *ApisApiController) GetApiCRD(w http.ResponseWriter, r *http.Request) {
func (c *ApisApiController) GetApiDefinition(w http.ResponseWriter, r *http.Request) {
params := mux.Vars(r)
namespaceParam := params["namespace"]

nameParam := params["name"]

result, err := c.service.GetApiDefinition(r.Context(), namespaceParam, nameParam)
// If an error occurred, encode the error with the status code
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion server/go/api_apis_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
*/

package openapi

2 changes: 1 addition & 1 deletion server/go/api_create_new_static_route_service_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func NewCreateNewStaticRouteApiService(kuskClient kusk.Client) CreateNewStaticRo

// CreateStaticRoute - create new static route
func (s *CreateNewStaticRouteApiService) CreateStaticRoute(ctx context.Context, staticRouteItem StaticRouteItem) (ImplResponse, error) {
staticRoute, err := s.kuskClient.CreateStaticRoute(staticRouteItem.Namespace, staticRouteItem.Name, staticRouteItem.EnvoyFleetNamespace, staticRouteItem.EnvoyFleetName)
staticRoute, err := s.kuskClient.CreateStaticRoute(staticRouteItem.Namespace, staticRouteItem.Name, staticRouteItem.EnvoyFleetName, staticRouteItem.EnvoyFleetNamespace)
if err != nil {
return Response(http.StatusInternalServerError, err), err
}
Expand Down
2 changes: 1 addition & 1 deletion server/go/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

// Response return a ImplResponse struct filled
func Response(code int, body interface{}) ImplResponse {
return ImplResponse {
return ImplResponse{
Code: code,
Body: body,
}
Expand Down
9 changes: 4 additions & 5 deletions server/go/model_api_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type ApiItem struct {

Name string `json:"name"`

Namespace string `json:"namespace"`
Expand All @@ -25,11 +24,11 @@ type ApiItem struct {
// AssertApiItemRequired checks if the required fields are not zero-ed
func AssertApiItemRequired(obj ApiItem) error {
elements := map[string]interface{}{
"name": obj.Name,
"name": obj.Name,
"namespace": obj.Namespace,
"fleet": obj.Fleet,
"service": obj.Service,
"version": obj.Version,
"fleet": obj.Fleet,
"service": obj.Service,
"version": obj.Version,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
Expand Down
3 changes: 1 addition & 2 deletions server/go/model_api_item_fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type ApiItemFleet struct {

Name string `json:"name"`

Namespace string `json:"namespace"`
Expand All @@ -19,7 +18,7 @@ type ApiItemFleet struct {
// AssertApiItemFleetRequired checks if the required fields are not zero-ed
func AssertApiItemFleetRequired(obj ApiItemFleet) error {
elements := map[string]interface{}{
"name": obj.Name,
"name": obj.Name,
"namespace": obj.Namespace,
}
for name, el := range elements {
Expand Down
3 changes: 1 addition & 2 deletions server/go/model_api_item_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type ApiItemService struct {

Name string `json:"name"`

Namespace string `json:"namespace"`
Expand All @@ -19,7 +18,7 @@ type ApiItemService struct {
// AssertApiItemServiceRequired checks if the required fields are not zero-ed
func AssertApiItemServiceRequired(obj ApiItemService) error {
elements := map[string]interface{}{
"name": obj.Name,
"name": obj.Name,
"namespace": obj.Namespace,
}
for name, el := range elements {
Expand Down
3 changes: 1 addition & 2 deletions server/go/model_envoy_fleet_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type EnvoyFleetItem struct {

Name string `json:"name"`

Namespace string `json:"namespace"`
Expand All @@ -25,7 +24,7 @@ type EnvoyFleetItem struct {
// AssertEnvoyFleetItemRequired checks if the required fields are not zero-ed
func AssertEnvoyFleetItemRequired(obj EnvoyFleetItem) error {
elements := map[string]interface{}{
"name": obj.Name,
"name": obj.Name,
"namespace": obj.Namespace,
}
for name, el := range elements {
Expand Down
1 change: 0 additions & 1 deletion server/go/model_inline_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type InlineObject struct {

Name string `json:"name,omitempty"`

Namespace string `json:"namespace,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion server/go/model_namespace_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ func AssertRecurseNamespaceItemRequired(objSlice interface{}) error {
}
return AssertNamespaceItemRequired(aNamespaceItem)
})
}
}
7 changes: 3 additions & 4 deletions server/go/model_service_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type ServiceItem struct {

Name string `json:"name"`

Status string `json:"status"`
Expand All @@ -23,10 +22,10 @@ type ServiceItem struct {
// AssertServiceItemRequired checks if the required fields are not zero-ed
func AssertServiceItemRequired(obj ServiceItem) error {
elements := map[string]interface{}{
"name": obj.Name,
"status": obj.Status,
"name": obj.Name,
"status": obj.Status,
"namespace": obj.Namespace,
"ports": obj.Ports,
"ports": obj.Ports,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
Expand Down
9 changes: 4 additions & 5 deletions server/go/model_service_port_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type ServicePortItem struct {

Name string `json:"name"`

NodePort int32 `json:"nodePort"`
Expand All @@ -25,10 +24,10 @@ type ServicePortItem struct {
// AssertServicePortItemRequired checks if the required fields are not zero-ed
func AssertServicePortItemRequired(obj ServicePortItem) error {
elements := map[string]interface{}{
"name": obj.Name,
"nodePort": obj.NodePort,
"port": obj.Port,
"protocol": obj.Protocol,
"name": obj.Name,
"nodePort": obj.NodePort,
"port": obj.Port,
"protocol": obj.Protocol,
"targetPort": obj.TargetPort,
}
for name, el := range elements {
Expand Down
3 changes: 1 addition & 2 deletions server/go/model_static_route_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type StaticRouteItem struct {

Name string `json:"name"`

Namespace string `json:"namespace"`
Expand All @@ -23,7 +22,7 @@ type StaticRouteItem struct {
// AssertStaticRouteItemRequired checks if the required fields are not zero-ed
func AssertStaticRouteItemRequired(obj StaticRouteItem) error {
elements := map[string]interface{}{
"name": obj.Name,
"name": obj.Name,
"namespace": obj.Namespace,
}
for name, el := range elements {
Expand Down
3 changes: 1 addition & 2 deletions server/go/model_static_route_item_fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package openapi

type StaticRouteItemFleet struct {

Name string `json:"name"`

Namespace string `json:"namespace"`
Expand All @@ -19,7 +18,7 @@ type StaticRouteItemFleet struct {
// AssertStaticRouteItemFleetRequired checks if the required fields are not zero-ed
func AssertStaticRouteItemFleetRequired(obj StaticRouteItemFleet) error {
elements := map[string]interface{}{
"name": obj.Name,
"name": obj.Name,
"namespace": obj.Namespace,
}
for name, el := range elements {
Expand Down

0 comments on commit d0aebab

Please sign in to comment.