Skip to content
@go-sdk

go-sdk

Go SDK

Minimal, focused Go modules for building services and applications with consistent configuration, logging, lifecycle, database, and transport conventions.

Each module can be used independently. For projects that adopt the complete stack, app provides a convention-based runtime that assembles the lower-level modules and keeps application entry points small.

Projects

Project Purpose Topics Docs
core Foundation utilities for configuration, logging, errors, lifecycle, command-line applications, HTTP clients, codecs, type conversion, IDs, and tests. golang configuration logging lifecycle utilities Doc
database GORM toolkit for MySQL, PostgreSQL, and SQLite with opt-in drivers, unified logging, connection-pool configuration, versioned migrations, cross-replica locks, JSON fields, millisecond soft deletes, and a Redis client with lease locks. golang gorm redis sql database-migrations Doc
server gRPC and grpc-gateway server on one port with shared request context, structured responses, JWT authentication, permission and audit hooks, Protovalidate, i18n, recovery, TLS, payload logging with redaction, health checks, and graceful shutdown. golang grpc grpc-gateway http-server jwt Doc
taskkit Go task library built on gocron v2, providing an auto-started dynamic job manager with cron, interval, and one-off schedules, per-job context with run IDs, unified logging and panic recovery, optional distributed locking, and a generic bounded-concurrency parallel executor. golang cron scheduler concurrency distributed-lock Doc
certkit X.509 certificate and key store toolkit for parsing, merging, conversion, issuance, revocation checking, trust-root construction, and per-version TLS inspection including TLCP, supporting RSA, ECDSA, and SM2. golang x509 pki tls sm2 Doc
qbot Go SDK for QQ bot private and group messaging, providing access token management, text message sending, and signed Webhook callbacks. golang qq-bot chatbot webhook sdk Doc
camoufox Go SDK for connecting to a remote Camoufox Firefox browser, creating isolated sessions, and saving and restoring login state. Page operations use the native Playwright API. golang camoufox firefox playwright browser-automation Doc
app Convention-based integration layer for core, database, server, and taskkit, including global configuration, database and Redis access, migration and bootstrap registration, transport and task registration, and process lifecycle. golang application-framework bootstrap lifecycle configuration Doc
example Reference application using app: Proto-driven PostgreSQL RBAC APIs, file routes, migrations, Docker Compose, generated Gateway bindings, and OpenAPI output. golang grpc rbac postgresql docker-compose Doc

Versions

Project Version Last Commit
core GitHub Tag GitHub last commit
database GitHub Tag GitHub last commit
server GitHub Tag GitHub last commit
taskkit GitHub Tag GitHub last commit
certkit GitHub Tag GitHub last commit
qbot GitHub Tag GitHub last commit
camoufox GitHub Tag GitHub last commit
app GitHub Tag GitHub last commit

Choose a Starting Point

  • Use app when a service can adopt the standard configuration, database, migration, server, and lifecycle conventions.
  • Compose core, database, and server directly when the application needs a custom runtime or only part of the stack.
  • Start from example when you want a complete, working project structure rather than isolated API examples.
  • Add taskkit to any stack when a service needs scheduled or dynamically managed jobs, or bounded-concurrency parallel execution.
  • Add certkit to any stack when a service needs certificate handling, key stores, revocation checking, or TLS inspection.
  • Add qbot to any stack when a service needs QQ bot integration via private or group text messaging and signed Webhook callbacks.
  • Use camoufox when an application needs to control a remote Camoufox browser with Playwright or reuse login state across sessions.

Architecture

example ──> app ──┬──> core
                  ├──> database ──> core
                  ├──> server ────> core
                  └──> taskkit ───> core

certkit ──> core

qbot ──> core

camoufox ──> core

custom applications may also depend on core, database, or server directly

server and database remain independent. Within Go SDK, taskkit, certkit, qbot, and camoufox depend only on core. app assembles core, database, server, and taskkit to provide a standard startup and shutdown path.

Getting Started

All modules require Go 1.27 or newer.

For a convention-based application:

go get github.com/go-sdk/app@latest

Keep the executable entry point declarative and import only the database driver the application actually uses:

package main

import (
	"github.com/go-sdk/app"
	_ "github.com/go-sdk/database/dbx/postgres"

	_ "example/internal/migration"
	_ "example/internal/route"
	_ "example/internal/service"
)

func main() {
	app.Main()
}

See the app documentation for registration and configuration details, or the example repository for an end-to-end implementation.

For standalone modules:

go get github.com/go-sdk/core@latest
go get github.com/go-sdk/database@latest
go get github.com/go-sdk/server@latest
go get github.com/go-sdk/taskkit@latest
go get github.com/go-sdk/certkit@latest
go get github.com/go-sdk/qbot@latest
go get github.com/go-sdk/camoufox@latest

camoufox supports linux/amd64 and linux/arm64. Install the matching Playwright driver on the client before connecting to a remote Camoufox server. See the camoufox README for driver setup, version compatibility, and session examples.

Design Principles

  • Minimal — keep APIs small and dependencies intentional.
  • Consistent — share conventions for configuration, context, logging, errors, and lifecycle.
  • Composable — use individual modules or adopt the integrated application runtime.
  • Explicit — import database drivers and register migrations, transports, and application initialization deliberately.
  • Practical — provide useful defaults while keeping important behavior configurable.
  • Modern Go — target current Go releases and standard-library capabilities.

Community

Questions, ideas, and feedback are welcome in GitHub Discussions.


Go SDK 中文

一组精简、专注的 Go 模块,用统一的配置、日志、生命周期、数据库和传输层约定构建服务与应用。

每个模块都可以独立使用。对于采用完整技术栈的项目,app 提供约定式运行时,负责组装底层模块, 让应用入口保持简洁。

项目

项目 定位 Topics 文档
core 基础工具库,提供配置、日志、错误处理、生命周期、命令行、HTTP 客户端、编解码、类型转换、ID 和测试辅助。 golang configuration logging lifecycle utilities 文档
database 基于 GORM 的 MySQL、PostgreSQL 和 SQLite 工具库,提供按需驱动、统一日志、连接池配置、版本迁移、跨副本锁、JSON 字段、毫秒软删除,以及带租约锁的 Redis 客户端。 golang gorm redis sql database-migrations 文档
server 在同一端口提供 gRPC 和 grpc-gateway,统一请求上下文、响应结构、JWT 鉴权、权限与审计钩子、Protovalidate、国际化、Recovery、TLS、带脱敏的 Payload 日志、健康检查和优雅停止。 golang grpc grpc-gateway http-server jwt 文档
taskkit 基于 gocron v2 的任务基础类库,提供自动启动的动态任务管理器,支持 Cron、间隔和一次性调度、任务级 Context、统一日志与 panic 恢复、可选分布式锁,以及泛型受控并发执行器。 golang cron scheduler concurrency distributed-lock 文档
certkit 统一的 X.509 证书工具包,支持证书、私钥、密钥库的解析、合并、转换、签发、吊销检查、信任根、TLS 分版本探测(含 TLCP),覆盖 RSA、ECDSA 和 SM2。 golang x509 pki tls sm2 文档
qbot QQ 机器人单聊和群聊的 Go SDK,提供 Access Token 管理、文本消息发送和 Webhook 验签接收。 golang qq-bot chatbot webhook sdk 文档
camoufox 用于连接远程 Camoufox Firefox 的 Go SDK,支持独立会话以及登录状态的保存和恢复,页面操作使用原生 Playwright API。 golang camoufox firefox playwright browser-automation 文档
app core、database、server 和 taskkit 的约定式整合层,统一全局配置、数据库与 Redis 访问、迁移与 Bootstrap、传输层与任务注册和进程生命周期。 golang application-framework bootstrap lifecycle configuration 文档
example 基于 app 的完整参考项目,包含 Proto 驱动的 PostgreSQL RBAC API、文件路由、迁移、Docker Compose、Gateway 生成代码和 OpenAPI。 golang grpc rbac postgresql docker-compose 文档

版本

项目 版本 最近提交
core GitHub Tag GitHub last commit
database GitHub Tag GitHub last commit
server GitHub Tag GitHub last commit
taskkit GitHub Tag GitHub last commit
certkit GitHub Tag GitHub last commit
qbot GitHub Tag GitHub last commit
camoufox GitHub Tag GitHub last commit
app GitHub Tag GitHub last commit

如何选择

  • 服务可以接受统一的配置、数据库、迁移、Server 和生命周期约定时,优先使用 app。
  • 需要自定义运行时或只需要部分能力时,直接组合 core、 database 和 server。
  • 希望从完整项目结构开始,而不是只查看零散 API 示例时,参考 example。
  • 需要定时或动态管理的任务以及受控并发执行时,加入 taskkit。
  • 需要在任意方案中处理证书、密钥库、吊销检查或 TLS 探测时,加入 certkit。
  • 需要通过单聊、群聊文本消息和 Webhook 验签接收接入 QQ 机器人时,加入 qbot。
  • 需要通过 Playwright 操作远程 Camoufox 浏览器,或跨会话复用登录状态时,使用 camoufox。

架构

example ──> app ──┬──> core
                  ├──> database ──> core
                  ├──> server ────> core
                  └──> taskkit ───> core

certkit ──> core

qbot ──> core

camoufox ──> core

自定义应用也可以直接依赖 core、database 或 server

server 与 database 保持相互独立。在 Go SDK 的模块中,taskkit、certkit、 qbot 和 camoufox 只依赖 core。 app 整合 core、database、server 和 taskkit,为应用提供统一的启动和停止流程。

快速开始

全部模块要求 Go 1.27 或更高版本。

创建约定式应用:

go get github.com/go-sdk/app@latest

应用入口只声明业务注册包,并按需导入实际使用的数据库驱动:

package main

import (
	"github.com/go-sdk/app"
	_ "github.com/go-sdk/database/dbx/postgres"

	_ "example/internal/migration"
	_ "example/internal/route"
	_ "example/internal/service"
)

func main() {
	app.Main()
}

注册方式和默认配置参见 app 文档,完整实现参见 example 项目。

按需安装独立模块:

go get github.com/go-sdk/core@latest
go get github.com/go-sdk/database@latest
go get github.com/go-sdk/server@latest
go get github.com/go-sdk/taskkit@latest
go get github.com/go-sdk/certkit@latest
go get github.com/go-sdk/qbot@latest
go get github.com/go-sdk/camoufox@latest

camoufox 支持 linux/amd64 和 linux/arm64。连接远程 Camoufox 服务前,需要在客户端预装配套的 Playwright 驱动。驱动准备、版本兼容要求和会话示例参见 camoufox README。

设计原则

  • 精简 — 保持 API 简洁,并谨慎引入依赖。
  • 一致 — 对配置、上下文、日志、错误和生命周期采用统一约定。
  • 可组合 — 既可以独立使用模块,也可以采用整合后的应用运行时。
  • 显式 — 数据库驱动、迁移、传输层和业务初始化均由具体项目主动声明。
  • 实用 — 提供合理默认行为,同时保留关键配置能力。
  • 现代 Go — 面向当前 Go 版本和标准库能力进行设计。

交流

欢迎在 GitHub Discussions 提问、分享想法和反馈。

Pinned Loading

  1. core core Public

    Foundation utilities for configuration, logging, errors, lifecycle, command-line applications, HTTP clients, codecs, type conversion, IDs, and tests.

    Go

  2. database database Public

    GORM toolkit for MySQL, PostgreSQL, and SQLite with opt-in drivers, unified logging, connection-pool configuration, versioned migrations, cross-replica locks, JSON fields, millisecond soft deletes,…

    Go

  3. server server Public

    gRPC and grpc-gateway server on one port with shared request context, structured responses, JWT authentication, permission and audit hooks, Protovalidate, i18n, recovery, TLS, payload logging with …

    Go

  4. qbot qbot Public

    Go SDK for QQ bot private and group messaging, providing access token management, text message sending, and signed Webhook callbacks.

    Go

  5. taskkit taskkit Public

    Go task library built on gocron v2, providing an auto-started dynamic job manager with cron, interval, and one-off schedules, per-job context with run IDs, unified logging and panic recovery, optio…

    Go

  6. certkit certkit Public

    X.509 certificate and key store toolkit for parsing, merging, conversion, issuance, revocation checking, trust-root construction, and per-version TLS inspection including TLCP, supporting RSA, ECDS…

    Go

Repositories

Showing 10 of 12 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…