// DumpJSON prints notification in json format
333651
func (n *DebugMsg) DumpJSON(cpuPrefix string) {
	fmt.Println(n.getJSON(cpuPrefix))
}
499878
func (v RegistryMessage) MarshalJSON() ([]byte, error) {
	w := jwriter.Writer{}
	easyjson639f989aEncodeCodeCloudfoundryOrgGorouterMbus2(&w, v)
	return w.Buffer.BuildBytes(), w.Error
}
322027
func ioOutputFormatJsonMessage(ld *LineData, b *bytes.Buffer) error {
	msg, err := json.Marshal(ld.Message)
	if err != nil {
		return err
	}

	_, err = b.WriteString(string(msg))
	return err
}
287660
func (h *Handle) DumpStatsToJSON(dbName string, tableInfo *model.TableInfo) (*JSONTable, error) {
	pi := tableInfo.GetPartitionInfo()
	if pi == nil {
		return h.tableStatsToJSON(dbName, tableInfo, tableInfo.ID)
	}
	jsonTbl := &JSONTable{
		DatabaseName: dbName,
		TableName:    tableInfo.Name.L,
		Partitions:   make(map[string]*JSONTable, len(pi.Definitions)),
	}
	for _, def := range pi.Definitions {
		tbl, err := h.tableStatsToJSON(dbName, tableInfo, def.ID)
		if err != nil {
			return nil, errors.Trace(err)
		}
		if tbl == nil {
			continue
		}
		jsonTbl.Partitions[def.Name.L] = tbl
	}
	return jsonTbl, nil
}
781087
func (m *FlexMessage) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type       MessageType      `json:"type"`
		AltText    string           `json:"altText"`
		Contents   interface{}      `json:"contents"`
		QuickReply *QuickReplyItems `json:"quickReply,omitempty"`
	}{
		Type:       MessageTypeFlex,
		AltText:    m.AltText,
		Contents:   m.Contents,
		QuickReply: m.quickReplyitems,
	})
}
945852
func _json_marshal(obj interface{}) []byte {
	buf, err := json.MarshalIndent(obj, "", "  ")
	if err != nil {
		panic(err)
	}
	return buf
}
266118
func PrintJSON(in interface{}) error {
	var j []byte
	var err error
	if JSONPretty {
		j, err = json.MarshalIndent(in, JSONPrefix, JSONIndent)
	} else {
		j, err = json.Marshal(in)
	}
	if err != nil {
		return err
	}
	fmt.Println(string(j))
	return nil
}
155938
func (m *TextMessage) MarshalJSON() ([]byte, error) {
	return json.Marshal(&struct {
		Type       MessageType      `json:"type"`
		Text       string           `json:"text"`
		QuickReply *QuickReplyItems `json:"quickReply,omitempty"`
	}{
		Type:       MessageTypeText,
		Text:       m.Text,
		QuickReply: m.quickReplyitems,
	})
}
537483
func (n *DropNotify) DumpInfo(data []byte) {
	fmt.Printf("xx drop (%s) flow %#x to endpoint %d, identity %d->%d: %s\n",
		api.DropReason(n.SubType), n.Hash, n.DstID, n.SrcLabel, n.DstLabel,
		GetConnectionSummary(data[DropNotifyLen:]))
}
1120845
func (qs *QuietStatus) PrintMsg(msg message) {
	if !globalJSON {
		console.Println(msg.String())
	} else {
		console.Println(msg.JSON())
	}
}
636400
func (s *Swarm) Dump() string {
	str := s.String() + "\n"

	s.listenerLock.Lock()
	for l, _ := range s.listeners {
		str += fmt.Sprintf("\t%s %v\n", l, l.Groups())
	}
	s.listenerLock.Unlock()

	s.connLock.Lock()
	for c, _ := range s.conns {
		str += fmt.Sprintf("\t%s %v\n", c, c.Groups())
	}
	s.connLock.Unlock()

	s.streamLock.Lock()
	for ss, _ := range s.streams {
		str += fmt.Sprintf("\t%s %v\n", ss, ss.Groups())
	}
	s.streamLock.Unlock()

	return str
}
277077
func (ds *DummyStatus) PrintMsg(msg message) {
	if !globalJSON {
		console.Println(msg.String())
	} else {
		console.Println(msg.JSON())
	}
}
91027
func (pn *PushNotification) PayloadString() (string, error) {
	j, err := pn.PayloadJSON()
	return string(j), err
}
854785
func PrintJSON(v interface{}) {
	body, err := json.MarshalIndent(v, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Printf("%s\n", body)
}
938135
func (n *DebugCapture) DumpInfo(data []byte) {
	prefix := n.infoPrefix()

	if len(prefix) > 0 {
		fmt.Printf("%s: %s\n", prefix, GetConnectionSummary(data[DebugCaptureLen:]))
	}
}
407049
func (b *boxedMessage) Dump() []byte {
	pub := base64.StdEncoding.EncodeToString(b.EncrypterPublic[:])
	nonce := base64.StdEncoding.EncodeToString(b.Nonce[:])
	box := base64.StdEncoding.EncodeToString(b.Box)

	str := fmt.Sprintf("EJ[%d:%s:%s:%s]",
		b.SchemaVersion, pub, nonce, box)
	return []byte(str)
}
865486
func (m *Module) EmptyJSON(rw http.ResponseWriter, status int) error {
	rw.Header().Add("Content-Type", "application/json")
	rw.WriteHeader(status)
	_, err := rw.Write([]byte(`{}`))
	return err
}