address

package
v0.0.0-...-3cb445a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package address contains functionality to generate addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Nouns   []string
	Address config.Address
}

Generator is a generator of addresses.

func (*Generator) Random

func (g *Generator) Random() *ir.Address

Random generates a random address. The address will be in one of the following formats with equal probabilities:

  1. 1 line address: 222 XXX StreetSuffix PostCode City Country
  2. 2 lines address: 111 XXX House XXX StreetSuffix PostCode City Country

Where: 222 is a random number between [1, 200] 111 is a random number between [1, 100] XXX is a random noun StreetSuffix is a street suffix, eg.: Road, Street, Place etc. PostCode is a random post code. If the data configuration file contains a list of postcodes, it is chosen randomly among them. Otherwise, it is generated based on the country. City is a random city.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL