add /blogs/{blogID} and /blogs/lookup/{blogName} routes

This commit is contained in:
sam 2023-09-06 02:40:50 +02:00
parent dfc116d828
commit dd72a1f4c1
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
5 changed files with 104 additions and 1 deletions

View file

@ -126,7 +126,10 @@ const (
ErrMissingScope = 1002
// Account related
ErrAccountNotFound = 1003
ErrAccountNotFound = 2001
// Blog related
ErrBlogNotFound = 3001
)
func ErrCodeMessage(code int) string {
@ -145,6 +148,8 @@ var errCodeMessages = map[int]string{
ErrMissingScope: "Token is missing required scope for this endpoint",
ErrAccountNotFound: "Account not found",
ErrBlogNotFound: "Blog not found",
}
func ErrCodeStatus(code int) int {
@ -163,4 +168,6 @@ var errCodeStatuses = map[int]int{
ErrMissingScope: http.StatusForbidden,
ErrAccountNotFound: http.StatusNotFound,
ErrBlogNotFound: http.StatusNotFound,
}