1
0
mirror of https://github.com/go-kratos/kratos.git synced 2026-05-22 10:15:24 +02:00

errors: add errors coder (#946)

* add errors coder

* rename internal http to httputil

* add errors proto
This commit is contained in:
Tony Chen
2021-05-25 00:56:31 +08:00
committed by GitHub
parent 9a3a02fc68
commit cc0221b5ce
12 changed files with 326 additions and 119 deletions
@@ -1,4 +1,4 @@
package http
package httputil
import (
"net/http"
@@ -11,15 +11,6 @@ const (
baseContentType = "application"
)
var (
// HeaderAccept is accept header.
HeaderAccept = http.CanonicalHeaderKey("Accept")
// HeaderContentType is content-type header.
HeaderContentType = http.CanonicalHeaderKey("Content-Type")
// HeaderAcceptLanguage is accept-language header.
HeaderAcceptLanguage = http.CanonicalHeaderKey("Accept-Language")
)
// ContentType returns the content-type with base prefix.
func ContentType(subtype string) string {
return strings.Join([]string{baseContentType, subtype}, "/")
@@ -1,4 +1,4 @@
package http
package httputil
import "testing"