nested

package
v0.0.0-...-fe53453 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCalcService

func RegisterCalcService(e *echo.Echo, srv CalcService)

RegisterCalcService is used to bind routers

func RegisterCalcServiceWithPrefix

func RegisterCalcServiceWithPrefix(e *echo.Echo, srv CalcService, prefix string)

RegisterCalcServiceWithPrefix is used to bind routers with custom prefix

Types

type AddError

type AddError struct {
	Req   *AddReq `json:"req"`
	Error string  `json:"error"`
}

AddError

func (*AddError) GetError

func (r *AddError) GetError() string

func (*AddError) GetReq

func (r *AddError) GetReq() *AddReq

type AddReq

type AddReq struct {
	X int `json:"x"`
	Y int `json:"y"`
}

AddReq

func (*AddReq) GetX

func (r *AddReq) GetX() int

func (*AddReq) GetY

func (r *AddReq) GetY() int

type AddResp

type AddResp struct {
	Result int    `json:"result"`
	Extra  *Extra `json:"extra"`
}

AddResp

func (*AddResp) GetExtra

func (r *AddResp) GetExtra() *Extra

func (*AddResp) GetResult

func (r *AddResp) GetResult() int

type AuthError

type AuthError struct {
	Message string `json:"message"`
}

AuthError

func (*AuthError) GetMessage

func (r *AuthError) GetMessage() string

type BindError

type BindError struct {
	Message string `json:"message"`
}

BindError

func (*BindError) GetMessage

func (r *BindError) GetMessage() string

type CalcService

type CalcService interface {
	Add(c echo.Context, req *AddReq) (resp *AddResp, bizError *AddError, err error)
}

CalcService is the interface contains all the controllers

type CommonError

type CommonError struct {
	GenericError  *GenericError  `json:"genericError"`
	AuthError     *AuthError     `json:"authError"`
	ValidateError *ValidateError `json:"validateError"`
	BindError     *BindError     `json:"bindError"`
}

CommonError

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 Empty

type Empty struct {
}

Empty

type Extra

type Extra struct {
	Message string `json:"message"`
}

Extra

func (*Extra) GetMessage

func (r *Extra) GetMessage() string

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 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL