Documentation ¶
Overview ¶
Package ecode is the package that unifies the definition of http error codes or grpc error codes here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Success = errcode.Success InvalidParams = errcode.InvalidParams InternalServerError = errcode.InternalServerError NotFound = errcode.NotFound AlreadyExists = errcode.AlreadyExists Timeout = errcode.Timeout TooManyRequests = errcode.TooManyRequests Forbidden = errcode.Forbidden LimitExceed = errcode.LimitExceed DeadlineExceeded = errcode.DeadlineExceeded AccessDenied = errcode.AccessDenied MethodNotAllowed = errcode.MethodNotAllowed Canceled = errcode.Canceled Unknown = errcode.Unknown PermissionDenied = errcode.PermissionDenied ResourceExhausted = errcode.ResourceExhausted FailedPrecondition = errcode.FailedPrecondition Aborted = errcode.Aborted OutOfRange = errcode.OutOfRange Unimplemented = errcode.Unimplemented DataLoss = errcode.DataLoss )
http system level error code, error code range 10000~20000
View Source
var ( StatusSuccess = errcode.StatusSuccess StatusCanceled = errcode.StatusCanceled StatusUnknown = errcode.StatusUnknown StatusInvalidParams = errcode.StatusInvalidParams StatusDeadlineExceeded = errcode.StatusDeadlineExceeded StatusNotFound = errcode.StatusNotFound StatusAlreadyExists = errcode.StatusAlreadyExists StatusPermissionDenied = errcode.StatusPermissionDenied StatusResourceExhausted = errcode.StatusResourceExhausted StatusFailedPrecondition = errcode.StatusFailedPrecondition StatusAborted = errcode.StatusAborted StatusOutOfRange = errcode.StatusOutOfRange StatusUnimplemented = errcode.StatusUnimplemented StatusInternalServerError = errcode.StatusInternalServerError StatusDataLoss = errcode.StatusDataLoss StatusTimeout = errcode.StatusTimeout StatusTooManyRequests = errcode.StatusTooManyRequests StatusForbidden = errcode.StatusForbidden StatusLimitExceed = errcode.StatusLimitExceed StatusMethodNotAllowed = errcode.StatusMethodNotAllowed StatusAccessDenied = errcode.StatusAccessDenied )
rpc system level error code, with status prefix, error code range 30000~40000
View Source
var ( ErrCreateUserExample = errcode.NewError(userExampleBaseCode+1, "failed to create "+userExampleName) ErrDeleteByIDUserExample = errcode.NewError(userExampleBaseCode+2, "failed to delete "+userExampleName) ErrDeleteByIDsUserExample = errcode.NewError(userExampleBaseCode+3, "failed to delete by batch ids "+userExampleName) ErrUpdateByIDUserExample = errcode.NewError(userExampleBaseCode+4, "failed to update "+userExampleName) ErrGetByIDUserExample = errcode.NewError(userExampleBaseCode+5, "failed to get "+userExampleName+" details") ErrGetByConditionUserExample = errcode.NewError(userExampleBaseCode+6, "failed to get "+userExampleName+" details by conditions") ErrListByIDsUserExample = errcode.NewError(userExampleBaseCode+7, "failed to list by batch ids "+userExampleName) ErrListUserExample = errcode.NewError(userExampleBaseCode+8, "failed to list of "+userExampleName) )
userExample business-level http error codes. the userExampleNO value range is 1~100, if the same number appears, it will cause a failure to start the service.
View Source
var ( StatusCreateUserExample = errcode.NewRPCStatus(_userExampleBaseCode+1, "failed to create "+_userExampleName) StatusDeleteByIDUserExample = errcode.NewRPCStatus(_userExampleBaseCode+2, "failed to delete "+_userExampleName) StatusDeleteByIDsUserExample = errcode.NewRPCStatus(_userExampleBaseCode+3, "failed to delete by batch ids "+_userExampleName) StatusUpdateByIDUserExample = errcode.NewRPCStatus(_userExampleBaseCode+4, "failed to update "+_userExampleName) StatusGetByIDUserExample = errcode.NewRPCStatus(_userExampleBaseCode+5, "failed to get "+_userExampleName+" details") StatusGetByConditionUserExample = errcode.NewRPCStatus(_userExampleBaseCode+6, "failed to get "+_userExampleName+" by conditions") StatusListByIDsUserExample = errcode.NewRPCStatus(_userExampleBaseCode+7, "failed to list by batch ids "+_userExampleName) StatusListUserExample = errcode.NewRPCStatus(_userExampleBaseCode+8, "failed to list of "+_userExampleName) )
userExample business-level rpc error codes. the _userExampleNO value range is 1~100, if the same number appears, it will cause a failure to start the service.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.