Documentation ¶
Index ¶
- func RegisterTodolistService(e *echo.Echo, srv TodolistService)
- func RegisterTodolistServiceWithPrefix(e *echo.Echo, srv TodolistService, prefix string)
- type AddError
- type AddReq
- type AddResp
- type AuthError
- type BindError
- type CommonError
- type Empty
- type FieldError
- type GenericError
- type ListResp
- type Todo
- type TodolistService
- type ValidateError
- type ValidateErrorType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTodolistService ¶
func RegisterTodolistService(e *echo.Echo, srv TodolistService)
RegisterTodolistService is used to bind routers
func RegisterTodolistServiceWithPrefix ¶
func RegisterTodolistServiceWithPrefix(e *echo.Echo, srv TodolistService, prefix string)
RegisterTodolistServiceWithPrefix is used to bind routers with custom prefix
Types ¶
type AuthError ¶
type AuthError struct {
Message string `json:"message"`
}
AuthError
func (*AuthError) GetMessage ¶
type BindError ¶
type BindError struct {
Message string `json:"message"`
}
BindError
func (*BindError) GetMessage ¶
type CommonError ¶
type CommonError struct { GenericError *GenericError `json:"genericError"` AuthError *AuthError `json:"authError"` ValidateError *ValidateError `json:"validateError"` BindError *BindError `json:"bindError"` }
CommonError
func (*CommonError) Error ¶
func (r *CommonError) Error() string
func (*CommonError) GetAuthError ¶
func (r *CommonError) GetAuthError() *AuthError
func (*CommonError) GetBindError ¶
func (r *CommonError) GetBindError() *BindError
func (*CommonError) GetGenericError ¶
func (r *CommonError) GetGenericError() *GenericError
func (*CommonError) GetValidateError ¶
func (r *CommonError) GetValidateError() *ValidateError
type FieldError ¶
type FieldError struct { FieldName string `json:"fieldName"` ErrorType ValidateErrorType `json:"errorType"` }
FieldError
func (*FieldError) GetErrorType ¶
func (r *FieldError) GetErrorType() ValidateErrorType
func (*FieldError) GetFieldName ¶
func (r *FieldError) GetFieldName() string
type GenericError ¶
type GenericError struct {
Message string `json:"message"`
}
GenericError
func (*GenericError) GetMessage ¶
func (r *GenericError) GetMessage() string
type TodolistService ¶
type TodolistService interface { Add(c echo.Context, req *AddReq) (resp *AddResp, bizError *AddError, err error) List(c echo.Context, req *Empty) (resp *ListResp, err error) }
TodolistService is the interface contains all the controllers
type ValidateError ¶
type ValidateError struct {
Errors []*FieldError `json:"errors"`
}
ValidateError
func (*ValidateError) GetErrors ¶
func (r *ValidateError) GetErrors() []*FieldError
type ValidateErrorType ¶
type ValidateErrorType int
const ( INVALID_EMAIL ValidateErrorType = 0 FIELD_REQUIRED ValidateErrorType = 1 )
func (ValidateErrorType) Code ¶
func (code ValidateErrorType) Code() int
func (ValidateErrorType) IsFIELD_REQUIRED ¶
func (code ValidateErrorType) IsFIELD_REQUIRED() bool
func (ValidateErrorType) IsINVALID_EMAIL ¶
func (code ValidateErrorType) IsINVALID_EMAIL() bool
func (ValidateErrorType) String ¶
func (code ValidateErrorType) String() string
Click to show internal directories.
Click to hide internal directories.