Octri

Languages

Go

The Go SDK is distributed by git tag rather than a registry. Go modules resolve straight from a repository, so there is no account to connect.

Install

bash
go get github.com/your-org/api-client-go

Options

OptionValuesDefault
Client stylefunctions, namespaced, class, class-namespacedfunctions
Argument styleobject, positionalobject
Namespacetags, pathtags
Doc commentsfull, minimalfull
File headeromit, includeomit
Usage examplefull, concisefull

Go has no HTTP engine choice: the generated client uses the standard library.

Distribution

  1. Connect the GitHub App

    Octri needs push access to tag releases.

  2. Set the Go repository

    Set Repository for Go specifically. It usually differs from your other languages (acme-go, not acme-node).

  3. Release

    Octri pushes the generated code and a semver tag. go get resolves it from the tag.

The repository is the import path

This is the one decision in Go that you cannot walk back.

Changing the repo changes every import statement your users wrote

Go derives the module path from the repository URL and writes it into go.mod. github.com/acme/acme-go means users write:

go
import "github.com/acme/acme-go"

Rename or move the repo and every consumer's import breaks, with no deprecation path and no redirect. Go module paths are permanent in a way npm names are not.

Pick the Go repo name deliberately, before the first tag.

Major versions

Go encodes major versions above v1 in the module path:

text
github.com/acme/acme-go       v0 and v1
github.com/acme/acme-go/v2    v2 and up
v2 is a different import path

Publishing v2.0.0 means your users change their import line, not just their go.mod. That is the language's design, not Octri's, and it's worth staying on v1 while you can. See Versioning.

What callers write

go
package main

import (
    "context"
    "fmt"
    "os"

    acme "github.com/acme/acme-go"
)

func main() {
    client := acme.New(os.Getenv("ACME_TOKEN"))

    iter := client.Users.List(context.Background(), &acme.UserListParams{Limit: 100})
    for iter.Next() {
        fmt.Println(iter.Current().ID)
    }
}