SyncData resolves and returns the sync.Data from the path p.
(ctx context.Context, p *path.Capture)
| 27 | |
| 28 | // SyncData resolves and returns the sync.Data from the path p. |
| 29 | func SyncData(ctx context.Context, p *path.Capture) (*sync.Data, error) { |
| 30 | data, err := database.Build(ctx, &SynchronizationResolvable{Capture: p}) |
| 31 | if err != nil { |
| 32 | return nil, err |
| 33 | } |
| 34 | s, ok := data.(*sync.Data) |
| 35 | if !ok { |
| 36 | return nil, log.Errf(ctx, nil, "Could not get synchronization data") |
| 37 | } |
| 38 | return s, nil |
| 39 | } |
| 40 | |
| 41 | // Resolve builds a SynchronizationResolvable object for the given capture |
| 42 | func (r *SynchronizationResolvable) Resolve(ctx context.Context) (interface{}, error) { |