The anatomy of a cog

For the IGWEB project, we will be creating cogs in the $IGWEB_APP_ROOT/shared/cogs folder. You can take a peek at the time ago cog, whose implementation is found in the $IGWEB_APP_ROOT/shared/cogs/timeago folder, as you read through this section, to see a tangible implementation of the concepts presented herein. 

For the purposes of illustration only, we are going to walk you through the process of creating a simple cog called widget.

The project structure for the widget cog contained within the widget folder is organized in the following manner:

  ⁃ widget    ⁃ widget.go    ⁃ templates    ⁃ widget.tmpl

The widget.go source file will contain the implementation for the widget cog.

The templates folder contains the template source ...

Get Isomorphic Go now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.