Documentation ¶
Index ¶
Constants ¶
View Source
const ( BadRequestErrorCode = "400001" ForbiddenErrorCode = "403001" NotFoundsErrorCode = "404001" BadBodyErrorCode = "422001" AlreadyExistsErrorCode = "422002" )
View Source
const AccessObjectCollection string = "access_object"
View Source
const AccessTokensCollection string = "access_tokens"
View Source
const ProvidersCollection string = "providers"
Variables ¶
View Source
var MongoClient *mongo.Database
Functions ¶
func GetMongoClient ¶
Using this function to get a connection, you can create your connection pool here.
func GetTranslator ¶
func GetTranslator() *ut.Translator
func HexToPrimitiveIdRef ¶
func LoadMongoClient ¶
func LoadMongoClient()
func RegisterValidator ¶
Types ¶
type CommonError ¶
type CommonError struct {
Errors map[string]interface{} `json:"errors"`
}
func NewError ¶
func NewError(key string, err error) CommonError
func NewValidatorError ¶
func NewValidatorError(key string, errs validator.ValidationErrors) CommonError
To handle the error returned by c.Bind in gin framework https://github.com/go-playground/validator/blob/v9/_examples/translations/main.go
Click to show internal directories.
Click to hide internal directories.