refactor code structure (#1738)

This commit is contained in:
zryfish
2020-01-04 12:44:54 +08:00
committed by GitHub
parent eceadec69c
commit c40d1542a2
50 changed files with 695 additions and 456 deletions

View File

@@ -1,10 +1,8 @@
package api
import (
"github.com/emicklei/go-restful"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"net/http"
)
type ListResult struct {
@@ -158,13 +156,3 @@ const (
ResourceKindS2iBuilder = "s2ibuilders"
ResourceKindApplication = "applications"
)
func HandleInternalError(response *restful.Response, err error) {
statusCode := http.StatusInternalServerError
response.WriteError(statusCode, err)
}
func HandleBadRequest(response *restful.Response, err error) {
}

16
pkg/api/utils.go Normal file
View File

@@ -0,0 +1,16 @@
package api
import (
"github.com/emicklei/go-restful"
"net/http"
)
func HandleInternalError(response *restful.Response, err error) {
statusCode := http.StatusInternalServerError
response.WriteError(statusCode, err)
}
func HandleBadRequest(response *restful.Response, err error) {
}