Skip to main content
Topic: ApiGear Core

Golang SDK Template

The Go template generates a Golang module based on the module name and exposes clean interfaces based on the module interface. A core API which contain the single source of truth and a module code which is created as scaffolding code. For each interface a test file is also created.

The Go module allows to be extended and implemented based on the API core and the scaffolding files.

Following template feature switches are supported:

  • API - Only creates the interface files for you
  • Scaffold - Creates a full project with reference implementation and build system support.

In the generated source code you will find a README which explain in great detail how to build and use the code.



An interface like this counter will be directly transformed to an abstract C++ class.

- name: Counter
- name: count
type: int
- name: increment

The class will then later be used to be implemented by the customer.

type Counter interface {
GetCount() int
SetCount(count int)

Data Structures

A data structure like this message which contains one field, called text is transformed into a C++ class with public fields.

- name: Message
- name: text
type: string

A data structure is transformed to a Go struct type. As these API structs shall be able to be used outside of the module the fields are public.

type Message struct {
Text string = ""


A enumeration will be transformed to a set of constants.

- name: Direction
- name: Up
- name: Down
- name: Left
- name: Right

This is transformed to

type Direction int

const (
Up = 1
Down = 2
Left = 3
Right = 4