Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CodeKey = "code" MessageKey = "message" DataKey = "data" )
View Source
var ( // todo refactor etcd path and exchange path error ErrorUserNotAuthorized = aError("userNotAuthorized", "The user is not authorized, login first.", http.StatusUnauthorized) ErrorUserNotFound = aError("userNotFound", "The user is not exist.", http.StatusBadRequest) ErrorUserExisted = aError("userExisted", "The user is existed.", http.StatusOK) ErrorCreateUser = aError("userCreateFault", "The user save error.", http.StatusOK) ErrorUserPasswordIncorrect = aError("userPasswordIncorrect", "The password is incorrect for user.", http.StatusOK) ErrorDictionaryNotExist = aError("dictionaryNotExist", "The dictionary is not exist.", http.StatusBadRequest) ErrorEtcdPath = aError("pathError", "Build etcd path error", http.StatusBadRequest) ErrorNotExistState = aError("stateNotExist", "Current state is error", http.StatusBadRequest) NilExchangePath = aError("exchangePathError", "Exchange path is nil", http.StatusBadRequest) )
Functions ¶
This section is empty.
Types ¶
type EnvcdResult ¶
type EnvcdResult struct {
// response data
Data map[string]interface{}
// response http status code
HttpStatusCode int
}
EnvcdResult for response
func Failure ¶
func Failure(envcdError envcdError, err error) *EnvcdResult
Failure response
@param envcdError of envcd error @param err of handler error @return *EnvcdResult
func Failure0 ¶
func Failure0(envcdErr envcdError) *EnvcdResult
Failure0 response
@param envcdError of envcd error @return *EnvcdResult
func InternalFailure ¶
func InternalFailure(err error) *EnvcdResult
InternalFailure response
@return *EnvcdResult
func InternalFailure0 ¶
func InternalFailure0() *EnvcdResult
InternalFailure0 response
@return *EnvcdResult
func Success ¶
func Success(data interface{}) *EnvcdResult
Success response
@param data @return *EnvcdResult
Click to show internal directories.
Click to hide internal directories.