Skip to content

Commit

Permalink
replication: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmach committed Jun 7, 2022
1 parent 9299910 commit 012b26a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions replication/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
osm/replication [![Godoc Reference](https://godoc.org/github.com/paulmach/osm/replication?status.svg)](https://godoc.org/github.com/paulmach/osm/replication)
===============
# osm/replication [![Godoc Reference](https://pkg.go.dev/badge/github.com/paulmach/osm)](https://pkg.go.dev/github.com/paulmach/osm/replication)

Package `replication` handles fetching the Minute, Hour, Day and Changeset replication
and the associated state value from [Planet OSM](http://planet.osm.org).
Expand All @@ -18,3 +17,15 @@ Once you know the change number you want, fetch the change using:
```go
change, err := replication.Minute(ctx, num)
```

## Finding sequences numbers by timestamp

It's also possible to find the sequence number by timestamp.
These calls make multiple requests for state to find the one matching the given timestamp.

```go
MinuteStateAt(ctx context.Context, timestamp time.Time) (MinuteSeqNum, *State, error)
HourStateAt(ctx context.Context, timestamp time.Time) (HourSeqNum, *State, error)
DayStateAt(ctx context.Context, timestamp time.Time) (DaySeqNum, *State, error)
ChangesetStateAt(ctx context.Context, timestamp time.Time) (ChangesetSeqNum, *State, error)
```

0 comments on commit 012b26a

Please sign in to comment.