Documentation
¶
Index ¶
- Variables
- func DeleteJSON(url string, headers map[string]string, req interface{}, res interface{}) error
- func GetJSON(url string, headers map[string]string, res interface{}) error
- func JSON2XML(jsonStr string, opts ...J2XOption) (string, error)
- func ParseJSONRequest(r *http.Request, res interface{}) error
- func PostJSON(url string, headers map[string]string, req interface{}, res interface{}) error
- func PutJSON(url string, headers map[string]string, req interface{}, res interface{}) error
- func RequestJSON(method, url string, headers map[string]string, req interface{}, ...) error
- func XML2JSON(xmlStr string, opts ...X2JOption) (string, error)
- type Error
- type J2XOption
- type J2XOptions
- type JSONLibrary
- type X2JOption
- type X2JOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = New(nil)
Default the default json library
Functions ¶
func DeleteJSON ¶
DeleteJSON ...
func ParseJSONRequest ¶
ParseJSONRequest ...
Types ¶
type Error ¶
type Error struct {
InternalError error
Message string
URL string
Method string
Request []byte
Status int
Response []byte
}
Error struct
type J2XOption ¶
type J2XOption func(*J2XOptions) error
J2XOption is a function on the options for a json2xml.
func J2XWithIndent ¶
J2XWithIndent ...
type J2XOptions ¶
type J2XOptions struct {
WithIndent bool // well formatted json
Prefix string // the json marshal prefix
Indent string // the json marshal indent
RootTag string // the json root tag
}
J2XOptions ...
type JSONLibrary ¶
type JSONLibrary interface {
RequestJSON(method, url string, headers map[string]string, req interface{}, res interface{}) error
GetJSON(url string, headers map[string]string, res interface{}) error
PostJSON(url string, headers map[string]string, req interface{}, res interface{}) error
PutJSON(url string, headers map[string]string, req interface{}, res interface{}) error
DeleteJSON(url string, headers map[string]string, req interface{}, res interface{}) error
ParseJSONRequest(r *http.Request, res interface{}) error
JSON2XML(jsonStr string, opts ...J2XOption) (string, error)
XML2JSON(xmlStr string, opts ...X2JOption) (string, error)
}
JSONLibrary json library interface
type X2JOption ¶
type X2JOption func(*X2JOptions) error
X2JOption is a function on the options for a xml2json.
func X2JWithIndent ¶
X2JWithIndent ...
Click to show internal directories.
Click to hide internal directories.