# Functions
StateFromString returns the ShardState matching the given string representation.
ToShard takes a Lease object and transforms it to a Shard.
ToShards takes a list of Lease objects and transforms them to a list of Shards.
ToState returns the ShardState of the given Lease.
ToTimes parses the times and durations in the given Lease object and returns them in the Times representation.
# Constants
Dead is the ShardState if the Lease is Uncertain and was successfully acquired by the sharder.
Expired is the ShardState if the Lease has expired less than leaseDuration ago.
Orphaned is the ShardState if the Lease has been in state Dead for at least 1 minute.
Ready is the ShardState if the Lease is held by the shard and has not expired.
Uncertain is the ShardState if the Lease has expired at least leaseDuration ago.
Unknown is the ShardState if the Lease is not present or misses required fields.
# Type aliases
Shards is a list of Shards.
ShardState represents a state of a single shard which determines whether it is available for assigning objects to it or whether it is unhealthy.