Documentation
¶
Index ¶
- func BindAndValidate(c echo.Context, i interface{}) error
- func BlueMsg(s string) string
- func CalculateDestinationAddress(payload []byte, chainInfoBytes *chain.ChainInfoBytes) (destinationAddress string, err error)
- func ColorMethod(method string) string
- func ConvertUint64ToChainInfo(n uint64) (*chain.ChainInfo, error)
- func DecodeContractCallWithTokenPayload(payload []byte) (*encode.ContractCallWithTokenPayload, error)
- func GetFunctionName(f interface{}) string
- func HttpErrorHandler(err error, c echo.Context)
- func LogMap(data map[string][]string)
- func Logf(foreground ForegroundColor, v ...interface{}) string
- func MagentaMsg(s string) string
- func NormalizeAddress(address string, chainType types.ChainType) string
- func NormalizeHash(hash string) string
- func RandomNumber(n int) (string, error)
- func RandomString(n int) (string, error)
- func Request(opts *RequestOption) (*http.Request, *httptest.ResponseRecorder)
- func RequestLogMiddleware() echo.MiddlewareFunc
- func YellowMsg(s string) string
- type CustomValidator
- type ErrResponse
- type ForegroundColor
- type RequestOption
- type ValidationError
- type ValidationRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindAndValidate ¶
func CalculateDestinationAddress ¶
func CalculateDestinationAddress(payload []byte, chainInfoBytes *chain.ChainInfoBytes) (destinationAddress string, err error)
func ColorMethod ¶
func DecodeContractCallWithTokenPayload ¶
func DecodeContractCallWithTokenPayload(payload []byte) (*encode.ContractCallWithTokenPayload, error)
func GetFunctionName ¶
func GetFunctionName(f interface{}) string
func HttpErrorHandler ¶
func Logf ¶
func Logf(foreground ForegroundColor, v ...interface{}) string
func MagentaMsg ¶
func NormalizeHash ¶
func RandomNumber ¶
func RandomString ¶
func Request ¶
func Request(opts *RequestOption) (*http.Request, *httptest.ResponseRecorder)
func RequestLogMiddleware ¶
func RequestLogMiddleware() echo.MiddlewareFunc
Types ¶
type CustomValidator ¶
type CustomValidator struct {
// contains filtered or unexported fields
}
CustomValidator is type setting of third party validator
func (*CustomValidator) AddRules ¶
func (cv *CustomValidator) AddRules(rules ...ValidationRule) error
func (*CustomValidator) Validate ¶
func (cv *CustomValidator) Validate(i interface{}) error
type ErrResponse ¶
type ErrResponse struct {
Message string `json:"message"`
Metadata interface{} `json:"metadata,omitempty"`
}
type ForegroundColor ¶
type ForegroundColor int
const ( Black ForegroundColor = 30 Red ForegroundColor = 31 Green ForegroundColor = 32 Yellow ForegroundColor = 33 Blue ForegroundColor = 34 Magenta ForegroundColor = 35 Cyan ForegroundColor = 36 White ForegroundColor = 37 )
type RequestOption ¶
type ValidationError ¶
type ValidationError struct {
Message string `json:"message"`
Metadata map[string]interface{} `json:"metadata"`
}
func (ValidationError) Error ¶
func (ve ValidationError) Error() string
type ValidationRule ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.