MCPcopy
hub / github.com/rclone/rclone / UnmarshalJSON

Method UnmarshalJSON

backend/b2/api/types.go:74–81  ·  view source on GitHub ↗

UnmarshalJSON turns JSON into a Timestamp

(data []byte)

Source from the content-addressed store, hash-verified

72
73// UnmarshalJSON turns JSON into a Timestamp
74func (t *Timestamp) UnmarshalJSON(data []byte) error {
75 timestamp, err := strconv.ParseInt(string(data), 10, 64)
76 if err != nil {
77 return err
78 }
79 *t = Timestamp(time.Unix(timestamp/1e3, (timestamp%1e3)*1e6).UTC())
80 return nil
81}
82
83// HasVersion returns true if it looks like the passed filename has a timestamp on it.
84//

Callers 3

getOrHeadMethod · 0.95
internalTestMetadataMethod · 0.95

Calls 1

TimestampTypeAlias · 0.70

Tested by 2

internalTestMetadataMethod · 0.76