# README
osm/replication 
Package replication
handles fetching the Minute, Hour, Day and Changeset replication
and the associated state value from Planet OSM.
For example, to fetch the current Minute replication state:
num, fullState, err := replication.CurrentMinuteState(ctx)
This is the data in http://planet.osm.org/replication/minute/state.txt updated every minute.
Once you know the change number you want, fetch the change using:
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.
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)
# Functions
Changesets returns the complete list of changesets for the given replication sequence.
ChangesetState returns the state for the given changeset replication.
ChangesetStateAt will return the replication state/sequence number that contains data for the given timestamp.
CurrentChangesetState returns the current state of the changeset replication.
CurrentDayState returns the current state of the daily replication.
CurrentHourState returns the current state of the hourly replication.
CurrentMinuteState returns the current state of the minutely replication.
Day returns the change diff for a given day.
DayState returns the state of the given daily replication.
DayStateAt will return the replication state/sequence number that contains data for the given timestamp.
Hour returns the change diff for a given hour.
HourState returns the state of the given hourly replication.
HourStateAt will return the replication state/sequence number that contains data for the given timestamp.
Minute returns the change diff for a given minute.
MinuteState returns the state of the given minutely replication.
MinuteStateAt will return the replication state/sequence number that contains data for the given timestamp.
NewDatasource creates a Datasource using the given client.
NotFound will return try if the error from one of the methods was due to the file not found on the remote host.
# Constants
BaseURL defines the default planet server to hit.
DaySeqStart is the beginning of valid day sequence data.
HourSeqStart is the beginning of valid hour sequence data.
MinuteSeqStart is the beginning of valid minutely sequence data.
# Variables
DefaultDatasource is the Datasource used by the package level convenience functions.
# Structs
Datasource defines context around replication data requests.
State returns information about the current replication state.
UnexpectedStatusCodeError is return for a non 200 or 404 status code.
# Interfaces
SeqNum is an interface type that includes MinuteSeqNum, HourSeqNum and DaySeqNum.
# Type aliases
ChangesetSeqNum indicates the sequence of the changeset replication found here: https://planet.osm.org/replication/changesets/.
DaySeqNum indicates the sequence of the daily diff replication found here: http://planet.osm.org/replication/day.
HourSeqNum indicates the sequence of the hourly diff replication found here: http://planet.osm.org/replication/hour.
MinuteSeqNum indicates the sequence of the minutely diff replication found here: http://planet.osm.org/replication/minute.