Documentation ¶
Index ¶
- func Marshal(v interface{}) ([]byte, error)
- func MarshalToString(v interface{}) (string, error)
- func NewDecoder(reader io.Reader) *jsoniter.Decoder
- func NewEncoder(writer io.Writer) *jsoniter.Encoder
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalFromString(str string, v interface{}) error
- func WriteJSON(w http.ResponseWriter, obj interface{}) error
- type JsoniterJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, obj interface{}) error
WriteJSON marshals the given interface object and writes it with custom ContentType.
Types ¶
type JsoniterJSON ¶
type JsoniterJSON struct {
Data interface{}
}
JSON contains the given interface object.
func (JsoniterJSON) Render ¶
func (r JsoniterJSON) Render(w http.ResponseWriter) (err error)
Render (JSON) writes data with custom ContentType.
func (JsoniterJSON) WriteContentType ¶
func (r JsoniterJSON) WriteContentType(w http.ResponseWriter)
WriteContentType (JSON) writes JSON ContentType.
Click to show internal directories.
Click to hide internal directories.