Documentation ¶
Index ¶
- Constants
- Variables
- func BuildNextPageToken(pager PagerInfo) (string, error)
- func NewConflictError(msg string) error
- func NewFormatError(msg string) error
- func NewFriendlyError(msg string) error
- func NewInternalError(msg string) error
- func NewNotFoundError(msg string) error
- func NewValidateError(msg string, items []ValidateErrItem) error
- func RecoverPager(pager PagerInfo) (bool, error)
- type BaseError
- type CallSrvError
- type FileResponse
- type PagerInfo
- type Response
- type SortAble
- type SortInfo
- type SortPair
- type SpecCodeResponse
- type ValidateErrItem
- type ValidateError
Constants ¶
View Source
const ( ErrCodeInternal = 10000 ErrCodeNotFound = 10001 ErrCodeConflict = 10002 ErrCodeFriendly = 10003 ErrCodeValidate = 10004 ErrCodeFormat = 10005 )
Variables ¶
View Source
var ( ErrNotFound = &BaseError{Code: ErrCodeNotFound, Message: "data not found"} ErrConflict = &BaseError{Code: ErrCodeConflict, Message: "data is existed or has be updated"} )
Functions ¶
func BuildNextPageToken ¶
It is google web API, please refer https://cloud.google.com/apis/design/design_patterns#list_pagination
func NewConflictError ¶
func NewFormatError ¶
func NewFriendlyError ¶
func NewInternalError ¶
func NewNotFoundError ¶
func NewValidateError ¶
func NewValidateError(msg string, items []ValidateErrItem) error
func RecoverPager ¶
Types ¶
type CallSrvError ¶
type FileResponse ¶
func (*FileResponse) Get ¶
func (r *FileResponse) Get() (name, contentType string, content []byte)
type Response ¶
type SortAble ¶
type SortAble struct { // format: "field[ desc], field2[ desc]" OrderBy string `json:"order_by" form:"order_by" auto_read:"order_by"` }
func (*SortAble) GetSortInfo ¶
type SpecCodeResponse ¶
func (*SpecCodeResponse) GetStatusCode ¶
func (r *SpecCodeResponse) GetStatusCode() int
type ValidateErrItem ¶
type ValidateError ¶
type ValidateError struct {
BaseError
}
Click to show internal directories.
Click to hide internal directories.