Documentation
¶
Index ¶
- Constants
- Variables
- func EqualsSyscallErrno(err error, sen syscall.Errno) bool
- func HasContentType(h http.Header, mimetype string) bool
- func HexPre(bs []byte) string
- func IsBrokenPipeError(err error) bool
- func IsConnectRefusedError(err error) bool
- func MultipartCopy(mw *multipart.Writer, fieldName string, r io.Reader) error
- func MultipartFile(mw *multipart.Writer, fieldName, fileName string) error
- func MultipartJson(mw *multipart.Writer, fieldName string, v interface{}) error
- func NoneMiddlewareFunc(next echo.HandlerFunc) echo.HandlerFunc
- func StrLeft(n int, s string) string
- func StrToCamelCase(str string) string
- func StrToSnakeCase(str string) string
- func Unauthorized(readOnly bool) echo.MiddlewareFunc
- func UrlWithParams(reqUrl string, reqParams ...*url.Values) string
- func WrapFunc(fs ...func()) echo.MiddlewareFunc
- func WrapHandler(hs ...http.Handler) echo.HandlerFunc
- type Address
- func (a *Address) Bytes() []byte
- func (a *Address) Equal(a2 *Address) bool
- func (a *Address) ID() []byte
- func (a *Address) IsContract() bool
- func (a Address) MarshalJSON() ([]byte, error)
- func (a *Address) RLPDecodeSelf(d codec.Decoder) error
- func (a *Address) RLPEncodeSelf(e codec.Encoder) error
- func (a *Address) SetBytes(b []byte) error
- func (a *Address) SetString(s string) error
- func (a *Address) SetTypeAndID(ic bool, id []byte) error
- func (a *Address) String() string
- func (a *Address) UnmarshalJSON(b []byte) error
- type HexBytes
- type HexInt
- func (i *HexInt) Bytes() []byte
- func (i *HexInt) Clone() HexInt
- func (i *HexInt) MarshalBinary() (data []byte, err error)
- func (i HexInt) MarshalJSON() ([]byte, error)
- func (i *HexInt) SetBytes(bs []byte) *big.Int
- func (i HexInt) String() string
- func (i *HexInt) UnmarshalBinary(data []byte) error
- func (i *HexInt) UnmarshalJSON(b []byte) error
- type HexInt16
- type HexInt32
- type HexInt64
- type HexUint16
- type HexUint32
- type HexUint64
- type HttpClient
- func (c *HttpClient) Delete(reqUrl string, respPtr interface{}) (resp *http.Response, err error)
- func (c *HttpClient) Do(method, reqUrl string, reqPtr, respPtr interface{}) (resp *http.Response, err error)
- func (c *HttpClient) Get(reqUrl string, respPtr interface{}, reqParams ...*url.Values) (resp *http.Response, err error)
- func (c *HttpClient) Post(reqUrl string, respPtr interface{}) (resp *http.Response, err error)
- func (c *HttpClient) PostWithFile(reqUrl string, reqPtr interface{}, fieldName, fileName string, ...) (resp *http.Response, err error)
- func (c *HttpClient) PostWithJson(reqUrl string, reqPtr interface{}, respPtr interface{}) (resp *http.Response, err error)
- func (c *HttpClient) PostWithReader(reqUrl string, reqPtr interface{}, fieldName string, r io.Reader, ...) (resp *http.Response, err error)
- func (c *HttpClient) Stream(reqUrl string, reqPtr, respPtr interface{}, respFunc HttpStreamFunc, ...) (resp *http.Response, err error)
- type HttpError
- type HttpServer
- type HttpStreamFunc
- type JsonTemplate
- type RawHexBytes
Constants ¶
View Source
const ( AddressIDBytes = 20 AddressBytes = AddressIDBytes + 1 )
View Source
const (
DefaultHttpNetwork = "tcp"
)
View Source
const PrefixLen = 4
Variables ¶
View Source
var (
DefaultJsonTemplate = NewJsonTemplate("default")
)
Functions ¶
func IsConnectRefusedError ¶
func MultipartJson ¶
func NoneMiddlewareFunc ¶
func NoneMiddlewareFunc(next echo.HandlerFunc) echo.HandlerFunc
func StrToCamelCase ¶
func StrToSnakeCase ¶
func Unauthorized ¶
func Unauthorized(readOnly bool) echo.MiddlewareFunc
func WrapHandler ¶
Types ¶
type Address ¶
type Address [AddressBytes]byte
func NewAccountAddress ¶
func NewAddress ¶
func NewAddressFromString ¶
func NewContractAddress ¶
func (*Address) IsContract ¶
func (Address) MarshalJSON ¶
func (*Address) UnmarshalJSON ¶
type HexBytes ¶
type HexBytes []byte
func SliceOfHexBytes ¶
func (HexBytes) MarshalJSON ¶
func (*HexBytes) UnmarshalJSON ¶
type HexInt ¶
func (*HexInt) MarshalBinary ¶
func (HexInt) MarshalJSON ¶
func (*HexInt) UnmarshalBinary ¶
func (*HexInt) UnmarshalJSON ¶
type HexInt16 ¶
type HexInt16 struct {
Value int16
}
func (HexInt16) MarshalJSON ¶
func (*HexInt16) UnmarshalJSON ¶
type HexInt32 ¶
type HexInt32 struct {
Value int32
}
func (HexInt32) MarshalJSON ¶
func (*HexInt32) UnmarshalJSON ¶
type HexInt64 ¶
type HexInt64 struct {
Value int64
}
func (HexInt64) MarshalJSON ¶
func (*HexInt64) UnmarshalJSON ¶
type HexUint16 ¶
type HexUint16 struct {
Value uint16
}
func (HexUint16) MarshalJSON ¶
func (*HexUint16) UnmarshalJSON ¶
type HexUint32 ¶
type HexUint32 struct {
Value uint32
}
func (HexUint32) MarshalJSON ¶
func (*HexUint32) UnmarshalJSON ¶
type HexUint64 ¶
type HexUint64 struct {
Value uint64
}
func (HexUint64) MarshalJSON ¶
func (*HexUint64) UnmarshalJSON ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(address string, contextPath string) *HttpClient
func (*HttpClient) Delete ¶
func (c *HttpClient) Delete(reqUrl string, respPtr interface{}) (resp *http.Response, err error)
func (*HttpClient) Do ¶
func (c *HttpClient) Do(method, reqUrl string, reqPtr, respPtr interface{}) (resp *http.Response, err error)
func (*HttpClient) Post ¶
func (c *HttpClient) Post(reqUrl string, respPtr interface{}) (resp *http.Response, err error)
func (*HttpClient) PostWithFile ¶
func (*HttpClient) PostWithJson ¶
func (c *HttpClient) PostWithJson(reqUrl string, reqPtr interface{}, respPtr interface{}) (resp *http.Response, err error)
func (*HttpClient) PostWithReader ¶
type HttpError ¶
type HttpError struct {
// contains filtered or unexported fields
}
func NewHttpError ¶
func (*HttpError) StatusCode ¶
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(address string, e *echo.Echo) *HttpServer
func (*HttpServer) Address ¶
func (s *HttpServer) Address() string
func (*HttpServer) Echo ¶
func (s *HttpServer) Echo() *echo.Echo
func (*HttpServer) ListenAddress ¶
func (s *HttpServer) ListenAddress() string
func (*HttpServer) Start ¶
func (s *HttpServer) Start() error
func (*HttpServer) Stop ¶
func (s *HttpServer) Stop() error
type HttpStreamFunc ¶
type HttpStreamFunc func(respPtr interface{}) error
type JsonTemplate ¶
func NewJsonTemplate ¶
func NewJsonTemplate(name string) *JsonTemplate
func (*JsonTemplate) Response ¶
func (t *JsonTemplate) Response(format string, v interface{}, resp *echo.Response) error
type RawHexBytes ¶
type RawHexBytes []byte
func (RawHexBytes) Bytes ¶
func (rh RawHexBytes) Bytes() []byte
func (RawHexBytes) MarshalJSON ¶
func (rh RawHexBytes) MarshalJSON() ([]byte, error)
func (RawHexBytes) String ¶
func (rh RawHexBytes) String() string
func (*RawHexBytes) UnmarshalJSON ¶
func (rh *RawHexBytes) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.