MCPcopy Create free account
hub / github.com/Shopify/ghostferry / UnmarshalJSON

Method UnmarshalJSON

state_tracker.go:67–90  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

65}
66
67func (s *SerializableState) UnmarshalJSON(data []byte) error {
68 type Alias SerializableState
69 aux := &struct {
70 LastSuccessfulPaginationKeys map[string]json.RawMessage
71 *Alias
72 }{
73 Alias: (*Alias)(s),
74 }
75
76 if err := json.Unmarshal(data, &aux); err != nil {
77 return err
78 }
79
80 s.LastSuccessfulPaginationKeys = make(map[string]PaginationKey)
81 for k, v := range aux.LastSuccessfulPaginationKeys {
82 pk, err := UnmarshalPaginationKey(v)
83 if err != nil {
84 return err
85 }
86 s.LastSuccessfulPaginationKeys[k] = pk
87 }
88
89 return nil
90}
91
92func (s *SerializableState) MinSourceBinlogPosition() mysql.Position {
93 nilPosition := mysql.Position{}

Callers

nothing calls this directly

Calls 1

UnmarshalPaginationKeyFunction · 0.85

Tested by

no test coverage detected