/
sample_code_generated.go
37 lines (34 loc) · 1.89 KB
/
sample_code_generated.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2020 Lingfei Kong <colin404@foxmail.com>. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
// Code generated by "codegen -type=int"; DO NOT EDIT.
package code
// init register error codes defines in this source code to `github.com/marmotedu/errors`
func init() {
register(ErrUserNotFound, 404, "User not found")
register(ErrUserAlreadyExist, 400, "User already exist")
register(ErrReachMaxCount, 400, "Secret reach the max count")
register(ErrSecretNotFound, 404, "Secret not found")
register(ErrSuccess, 200, "OK")
register(ErrUnknown, 500, "Internal server error")
register(ErrBind, 400, "Error occurred while binding the request body to the struct")
register(ErrValidation, 400, "Validation failed")
register(ErrTokenInvalid, 401, "Token invalid")
register(ErrDatabase, 500, "Database error")
register(ErrEncrypt, 401, "Error occurred while encrypting the user password")
register(ErrSignatureInvalid, 401, "Signature is invalid")
register(ErrExpired, 401, "Token expired")
register(ErrInvalidAuthHeader, 401, "Invalid authorization header")
register(ErrMissingHeader, 401, "The `Authorization` header was empty")
register(ErrorExpired, 401, "Token expired")
register(ErrPasswordIncorrect, 401, "Password was incorrect")
register(ErrPermissionDenied, 403, "Permission denied")
register(ErrEncodingFailed, 500, "Encoding failed due to an error with the data")
register(ErrDecodingFailed, 500, "Decoding failed due to an error with the data")
register(ErrInvalidJSON, 500, "Data is not valid JSON")
register(ErrEncodingJSON, 500, "JSON data could not be encoded")
register(ErrDecodingJSON, 500, "JSON data could not be decoded")
register(ErrInvalidYaml, 500, "Data is not valid Yaml")
register(ErrEncodingYaml, 500, "Yaml data could not be encoded")
register(ErrDecodingYaml, 500, "Yaml data could not be decoded")
}