TODO

  1. improve error handeling with "errors.Is"

    	if result.Error != nil {
    		if !errors.Is(result.Error, gorm.ErrRecordNotFound) {
    			return a, errors.New(errors.SERVER_ERROR, proper.error.message)
    		}
    	}
    
  2. add Localization module

  3. add custom error handeling in application.go like this sample:

    	func NewHTTPError(err error) *HttpError {
    		if custom, ok := err.(*CustomError); ok {
    			code, ok := HttpProtoStatus[custom.Status]
    			if !ok {
    				code = HttpProtoStatus[SERVER_ERROR]
    			}
    			return &HttpError{
    				Message:    custom.Message,
    				Status:     custom.Errors,
    				StatusCode: code,
    			}
    		}
    
    		return &HttpError{
    			Message:    lang.Use.Error.App.InternalError,
    			Status:     ProtocolMessage[SERVER_ERROR],
    			StatusCode: HttpProtoStatus[SERVER_ERROR],
    		}
    	}
    
  4. remove useless pointers from methods

  5. add rate limiter middleware with redis

  6. use better redis keys

  7. use enum in role constants