Gopher says
You did it! Part 1 is complete. You started as a passenger and now you can read the entire train system’s blueprints. Let’s take a moment to see how far you’ve come.
In baton-junction, you’ve now dissected every file - the client, the connector, the builders, the helpers - and understand the patterns behind every connector in the C1 ecosystem.
What You’ve Learned
Every level built on the last, and every concept came from connector code:
| Level | What You Learned | Where It’s Used |
|---|---|---|
| 0 | Setup, go build, project layout | Every level |
| 1 | Types, variables, constants, struct tags | Data models, JSON serialization |
| 2 | Functions, multi-return, err != nil | Every function in the connector |
| 3 | Structs, methods, pointer receivers | API models, builder structs |
| 4 | Interfaces, implicit satisfaction | ResourceSyncer, type assertions |
| 5 | Slices, maps, range, append | Resource lists, pagination |
| 6 | Packages, exported/unexported names | pkg/client, pkg/connector |
| 7 | Context, cancellation, logging | Every API call, structured logs |
| 8 | Standard library (fmt, net/http, json) | HTTP client, URL building |
| 9 | Protobuf, gRPC, SDK types, builders | v2.Resource, functional options |
| 10 | Testing, table-driven, httptest | Every _test.go file |
| 11 | Reading the full codebase | The whole connector |
Nothing was filler. If we taught it, you’ll use it.
What’s Coming in Part 2
Part 2 flips the script: instead of reading connector code, you’ll write it. You’ll build the same baton-junction connector from an empty directory to a working binary.
Level 13: Project Foundation - module init, directory structure, API models, HTTP client, connector struct, and the entry point.
Level 14: Connector Config - configuration fields, CLI flags, environment variables, and the go:generate pattern for typed config structs.
Level 15: Syncing Resources - resource type definitions, user/group/role builders, List methods, entitlements, grants, annotations, and expansion.
Level 16: Provisioning - Grant, Revoke, idempotency, the entity source rule, and account creation.
Level 17: Integration Tests - a full test suite that exercises the entire connector through its public API against a mock server.
Level 18: Standalone Test Server - a standalone mock API server for running the compiled connector in service mode against a C1 tenant.
Level 19: Validate and Run - building, running a one-shot sync, and inspecting the output with the baton CLI tool.
Every Baton connector follows the same workflow:
- Define resource types
- Build the HTTP client
- Implement
ResourceSyncerfor each type - Add entitlements and grants
- Implement provisioning (Grant/Revoke)
- Write tests
Once you’ve built one, you know how to build all of them.
Gopher says
You know types, functions, structs, interfaces, collections, packages, context, the standard library, protobuf, testing, and how they all fit together.
In baton-junction, Part 2 asks you to use everything you’ve learned to build a connector from scratch - but you’re ready. Turn the page and start building.
Next Lesson
Project Foundation

