July 2019
Intermediate to advanced
502 pages
14h
English
The main() function is the driver of the entire test. It turns on the mutual authentication between the link manager and the social graph manager, initializes the database, and runs the services (as long as the RUN_XXX_SERVICE environment variable is true):
func main() { // Turn on authentication err := os.Setenv("DELINKCIOUS_MUTUAL_AUTH", "true") Check(err) initDB() ctx := context.Background() defer KillServer(ctx) if os.Getenv("RUN_SOCIAL_GRAPH_SERVICE") == "true" { runSocialGraphService(ctx) } if os.Getenv("RUN_LINK_SERVICE") == "true" { runLinkService(ctx) }
Now it's ready to actually run the test. It uses the link manager client to connect to port 8080 on the localhost, which is where the link service is running. ...