Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var USAddresses = make([]Address, 0)
USAddresses stores the addresses loaded from the JSON data.
Functions ¶
func SSN ¶ added in v0.3.0
SSN will try to generate a valid random SSN by generating up until the given retries or until it generates a valid SSN whichever comes first. The retires default to 100 if no value is given. If formatted it will return a string with the format XXX-XX-XXXX opposed to non formatted XXXXXXXXX.
Types ¶
type Address ¶
type Address struct { Coordinates Locality string `json:"locality"` // city Country string `json:"country"` StreetNumber string `json:"street_number"` // e.g., 496 ... UnitNumber string `json:"unit_number"` // e.g., apt/unit... Route string `json:"route"` // street name PostalCode string `json:"postal_code"` // zip code AdministrativeAreaLevel1 string `json:"administrative_area_level_1"` // state }
Address represents an address that is loaded from an address file that uses the Starbucks locations in the US. See Google Autocomplete for more information on the naming of each field.
func USAddress ¶ added in v0.3.0
USAddress picks a random address from the initialized USAddresses. Note that for latitude, this only picks up to the 6th decimal place since some of the lat and long in the dataset contain around 13 decimal places. The reason for this limitation is unknown.
func USStateAddress ¶ added in v0.3.0
USStateAddress returns a random address from the initialized USAddresses that belongs to the specified state. It uses multiple goroutines to improve performance, with the number of goroutines specified by the 'routines' parameter. If 'routines' is 0, it defaults to 10.
type Coordinate ¶ added in v0.3.0
type Coordinate float64
Coordinate ...
func (*Coordinate) MarshalString ¶ added in v0.3.0
func (c *Coordinate) MarshalString(s string) error
MarshalString ...
func (*Coordinate) UnmarshalJSON ¶ added in v0.3.0
func (c *Coordinate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface, which allows us to ingest values of any json type as an int64 and run our custom conversion
type Coordinates ¶ added in v0.3.0
type Coordinates struct { Latitude Coordinate `json:"latitude,omitempty"` Longitude Coordinate `json:"longitude,omitempty"` }