Skip to content

feat: add Go SDK client - #6

Merged
shuence merged 1 commit into
mainfrom
feat/enterprise-backend-hardening
Sep 16, 2026
Merged

shuence merged 1 commit into
mainfrom
feat/enterprise-backend-hardening

Conversation

@shuence

@shuence shuence commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

Add a complete Go SDK client for the PageKit content API.

Features

  • Full API coverage: Posts (CRUD + slug lookup), Authors, Categories, Tags, Media
  • Retry with exponential backoff for 429 and 5xx errors (max 3 retries)
  • User-Agent header (pagekit-go/0.1.0)
  • X-Request-Id capture from server responses
  • Retry-After header support for rate limits
  • Zero external dependencies (stdlib only)
  • 30 tests passing with httptest mock server

Package structure

pagekit-go/
├── go.mod
├── pagekit.go      # Client with retry, User-Agent, request ID
├── types.go        # All API types matching TS SDK
├── errors.go       # PagekitError with IsRetryable/RateLimit
├── posts.go        # PostsService
├── authors.go      # AuthorsService
├── categories.go   # CategoriesService
├── tags.go         # TagsService
├── media.go        # MediaService
├── README.md       # Full docs with examples
├── LICENSE         # MIT
└── *_test.go       # 30 tests

Usage

client, _ := pagekit.NewClient("pk_live_...")
posts, _ := client.Posts.List(ctx, pagekit.PostListParams{
    Status: pagekit.Ptr(pagekit.PostStatusPublished),
})

- Add @arovi/pagekit-go package with full API coverage
- Posts: List, Get, GetBySlug, Create, Update, Delete
- Authors: List, Get
- Categories: List, GetBySlug
- Tags: List
- Media: List, Create, Delete
- Retry with exponential backoff (429 + 5xx, max 3 retries)
- User-Agent header (pagekit-go/0.1.0)
- X-Request-Id capture from server responses
- Retry-After header support for rate limits
- 30 tests passing with httptest mock server
- Zero external dependencies (stdlib only)
- Update pnpm-workspace.yaml to include pagekit-go

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Copilot AI lite review requested due to automatic review settings September 16, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@shuence
shuence merged commit f8fd10f into main Sep 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants