35 lines
535 B
Go
35 lines
535 B
Go
package statsapi
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type DiffPatchParams struct {
|
|
GamePk string
|
|
StartTimecode string
|
|
PushUpdateId string
|
|
}
|
|
|
|
type DiffPatchResponse []Patch
|
|
|
|
type Patch struct {
|
|
Diff []instruction
|
|
}
|
|
|
|
type instruction struct {
|
|
Op string
|
|
Path string
|
|
Value any
|
|
From string
|
|
}
|
|
|
|
func (p *Patch) Timestamp() (string, error) {
|
|
for _, d := range p.Diff {
|
|
if d.Op == "replace" && d.Path == "/metaData/timeStamp" {
|
|
return d.Value.(string), nil
|
|
}
|
|
}
|
|
|
|
return "", errors.New("could not find replacement timestamp")
|
|
}
|