service/api/message/json_param_entry.go

21 lines
384 B
Go

package message
import "strings"
type JsonParamEntry struct {
Name string
Value any
}
type JsonParamEntrySortable []*JsonParamEntry
func (p JsonParamEntrySortable) Len() int {
return len(p)
}
func (p JsonParamEntrySortable) Less(i, j int) bool {
return strings.Compare(p[i].Name, p[j].Name) == -1
}
func (p JsonParamEntrySortable) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}