Documentation ¶
Overview ¶
Package testaddress contains functionality to generate deterministic addresses for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ArbitraryGenerator = Generator{Country: "GBR", Cities: []string{"Cambridge", "London"}}
ArbitraryGenerator is a generator of addresses with predefined country and cities, to be used when the exact values do not matter.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
Generator generates addresses for testing.
func (*Generator) Random ¶
Random returns a deterministically different British address each time. The address will be in the following formats with equal probabilities:
n Test House n Test Street AB# #CD City Country
Where: n is a integer number that starts from 1 and increases by 1 for every address generated.
AB# #CD is a UK post code, where # is a digit that ranges between 0-9, increasing by 1 for every address generated and wrapping to 0. It is equivalent to the ones digit of n.
City is the nth city in the list of cities configured for the generator. After it reaches the end of the list, it will wrap back around to the beginning of the list.