|
|
@ -1,6 +1,7 @@
|
|
|
|
package types
|
|
|
|
package types
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -270,3 +271,17 @@ func (data Data) MustGetTimestamp(key string) Timestamp {
|
|
|
|
value, _ := data.GetTimestamp(key)
|
|
|
|
value, _ := data.GetTimestamp(key)
|
|
|
|
return value
|
|
|
|
return value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (data Data) JSON() ([]byte, error) {
|
|
|
|
|
|
|
|
bs, err := json.Marshal(&data)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return bs, nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (data Data) MustJSON() []byte {
|
|
|
|
|
|
|
|
bs, _ := data.JSON()
|
|
|
|
|
|
|
|
return bs
|
|
|
|
|
|
|
|
}
|
|
|
|