Skip to Content
Hands-On Software Engineering with Golang
book

Hands-On Software Engineering with Golang

by Achilleas Anagnostopoulos
January 2020
Intermediate to advanced
640 pages
16h 56m
English
Packt Publishing
Content preview from Hands-On Software Engineering with Golang

Defining an API for the PageRank calculator

Now, let's discuss how we can implement a PageRank calculator on top of the functionality provided by the graph processing framework we have built. The full source code and tests for the PageRank calculator can be found in this book's GitHub repository in the Chapter08/pagerank folder.

The Calculator type is nothing more than a container for a bspgraph.Graph instance and a bunch of configuration options:

type Calculator struct {
    g   *bspgraph.Graph
    cfg Config

    executorFactory bspgraph.ExecutorFactory
}

The executorFactory points to the executor factory that will be used to create new Executor instances each time we want to execute the PageRank algorithm on a graph. By default, the Calculator constructor ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Golang

Hands-On Software Architecture with Golang

Jyotiswarup Raiturkar

Publisher Resources

ISBN: 9781838554491Supplemental Content