go-sdk AGENTS.md

go-sdk AGENTS.md is an instructions file for Codex, OpenCode from qiniu/go-sdk. It costs 3,473 tokens per session, scanned A, original, MIT.

A maintenance guide for Qiniu Cloud’s Go software library, which lets Go programs use services such as object storage, content delivery, live streaming, messaging, and device connectivity. It explains the main packages, internal components, and how the library is organized.

In plain words
What is it for?
Use it when adding or fixing features in the Go SDK. It is a map of packages for authentication, storage, CDN, media, messaging, device services, and related internals.
Why use it?
It helps contributors find the right package and understand the boundaries between public APIs, shared HTTP clients, and generated code. It also makes the responsibilities of the many cloud-service packages clearer.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/qiniu/go-sdk/agents-md
Clone the repo
git clone --depth 1 https://github.com/qiniu/go-sdk

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-sdk AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/qiniu/go-sdk/agents-md.svg)](https://agentmods.dev/instructions/qiniu/go-sdk/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/qiniu/go-sdk/agents-md"><img src="https://agentmods.dev/badge/instructions/qiniu/go-sdk/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,473 This file is loaded in full into every session.
When invoked 3,473 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.03473 $0.03473
Opus 5 $0.01736 $0.01736
Sonnet 5 $0.00695 $0.00695
Haiku 4.5 $0.00347 $0.00347

Measured 4d ago against content hash 0b95d5546f42, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-sdk AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 341 lines

How it starts

The opening of the file, as written. The whole thing — 341 lines — stays where its author put it; the contents beside it link to each section on GitHub.

七牛云 Go SDK — 开发维护指南

七牛云官方 Go SDK,模块路径 github.com/qiniu/go-sdk/v7,Go 1.22+,MIT 许可。

本文档面向 SDK 维护者和贡献者,帮助理解项目结构、架构模式和开发流程。 SDK 的 API 使用说明请参考各包的 doc.go 文件和 examples/ 目录。

项目结构

顶层包

职责
auth 认证凭证(AK/SK)、HMAC-SHA1 签名、上传凭证、回调验证
storage 对象存储 v1:表单上传、分片上传、Bucket/对象管理、数据处理(pfop)
storagev2 对象存储 v2:类型化 API、自动区域检测、连接池、重试、Provider/Interface 模式
cdn CDN 加速:刷新、预取、流量/带宽查询、时间戳防盗链
pili 直播云:流管理、域名管理、推拉流地址生成
rtc 实时音视频:应用管理、房间 Token、用户管理
sms 短信:发送短信、签名/模板管理
linking IoT 设备联网:设备管理、密钥、录像片段
qvs 视频监控(QVS):GB/T 28181 设备接入、空间/设备/流管理
iam 身份与访问管理:用户、组、策略 CRUD(生成代码)
media 多媒体处理:Pfop 触发/Prefop 查询(生成代码)
audit 审计日志:日志查询(生成代码)
sandbox 沙箱环境:创建/管理沙箱、文件操作、命令执行、PTY 终端
client 底层 HTTP 客户端:请求签名、JSON/表单序列化、错误解析
conf 全局配置:SDK 版本号(conf.Version)、User-Agent 设置
reqid 请求 ID:通过 Context 传递 X-Reqid

internal 包

职责
internal/api-generator 代码生成器:读取 YAML API 规范生成类型化 Go 代码
internal/clientv2 HTTP 客户端 v2:拦截器链模式、认证注入、重试、防劫持
internal/cache 通用缓存
internal/hostprovider 主机地址提供者
internal/freezer 主机冻结/降级
internal/context Context 兼容层
internal/env 环境变量读取
internal/log 内部日志
internal/uplog 上传日志
internal/io IO 工具
internal/dialer 网络拨号
internal/configfile 配置文件读取

storagev2 子包

职责
storagev2/apis 低级 API 客户端,所有方法由代码生成器生成
storagev2/apistest API mock/测试辅助
storagev2/credentials 凭证管理(Provider 接口)
storagev2/http_client HTTP 客户端选项、拦截器集成
storagev2/region 区域信息(RegionsProvider 接口)
storagev2/uploader 上传管理器(自动选择上传方式)
storagev2/downloader 下载管理器
storagev2/objects 对象管理(流式 API)
storagev2/uptoken 上传凭证(PutPolicy → Signer)
storagev2/backoff 重试退避策略
storagev2/chooser 主机选择器
storagev2/resolver 域名解析器
storagev2/retrier 重试器
storagev2/defaults 默认配置值
storagev2/errors 类型化错误
storagev2/uplog 上传日志
storagev2/internal storagev2 内部实现

Read the full file on GitHub · 341 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 341 lines · 3,473 tokens per session scan A 0b95d5546f42

Subscribe to this mod's changes

go-sdk AGENTS.md is an instructions file published in the GitHub repository qiniu/go-sdk (157 stars, last pushed 1mo ago), licensed MIT. It adds 3,473 tokens to every session, about $0.0174 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.