go-asyncapi
БесплатноБез исполняемых скриптовНе проверенGo library that loads AsyncAPI 3 documents. `asyncapi.Load(path)` from `github.com/psyb0t/go-asyncapi` reads a YAML or JSON spec plus every file it references…
от psyb0t473 установки в других каталогахОб этом скилле
go-asyncapi
Loads AsyncAPI 3 documents in Go. One call, asyncapi.Load(path), gives you the servers, channels, operations and messages of a spec as plain structs, with $refs already followed and traits merged.
For install, the full type reference and schema walking, see references/setup.md.
Security & safety
- The library only reads files: the spec you pass to
Loadand the local files it references through relative$refs. It writes nothing and opens no network connection. A$refto anhttp(s)://URL fails withcommerr.ErrInvalidArgumentinstead of being fetched. - It compiles into your own binary and has no runtime surface of its own.
When to use
- Go code needs the contents of an AsyncAPI 3 spec: list channels and their messages, read server URLs, find which messages an operation sends or receives.
- You are writing a generator, linter, doc tool or test helper on top of AsyncAPI 3 and want
$refresolution and trait merging done for you. - The project already imports
github.com/psyb0t/go-asyncapi.
When NOT to use
- The spec is AsyncAPI 2.x.
Loadrejects it withcommerr.ErrInvalidValue; only 3.x documents load. - You want generated types and a client rather than a parsed document. Use gen-asyncapi, which is built on this library.
- You need full JSON Schema validation of payloads. go-asyncapi hands schemas back as
*asyncapi.Objecttrees and does not validate messages against them.
Usage
import (
"fmt"
asyncapi "github.com/psyb0t/go-asyncapi"
)
document, err := asyncapi.Load("asyncapi.yaml")
if err != nil {
return err // errors.Is(err, commerr.ErrNotFound) for a dangling $ref
}
for _, server := range document.Servers {
fmt.Println(server.Name, server.URL()) // variables filled with their defaults
}
for _, operation := range document.Operations {
if operation.Action != asyncapi.ActionReceive {
continue
}
for _, message := range operation.Messages {
fmt.Println(operation.Channel.Address, message.Name, message.ContentType)
}
}
Walking a payload schema:
message := document.Messages[0]
schema, at, err := document.Resolver.Deref(message.Payload, message.PayloadAt)
if err != nil {
return err
}
object, ok := schema.(*asyncapi.Object)
if !ok {
return nil // a boolean schema such as `payload: true`
}
properties := object.Object("properties")
if properties == nil {
return nil // not an object schema: oneOf, allOf, a primitive and so on
}
for _, name := range properties.Keys {
property, propertyAt, err := document.Resolver.Deref(
properties.Values[name],
at.Child("properties").Child(name),
)
if err != nil {
return err
}
_ = property // *asyncapi.Object, or a bool schema
_ = propertyAt // pass on to resolve $refs nested deeper
}
Always carry the Location that Deref returns and build child locations with Child. A $ref inside a schema resolves against the file that schema came from, and the location is how the resolver knows which file that is.
Установить go-asyncapi в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл go-asyncapi?
Go library that loads AsyncAPI 3 documents. `asyncapi.Load(path)` from `github.com/psyb0t/go-asyncapi` reads a YAML or JSON spec plus every file it references and returns a `*asyncapi.Document` with servers (URL and variables), channels (address, parameters, messages), operations (send/receive action, channel, messages, reply) and messages (payload, headers, correlationId, content type, bindings) in document order, with every `$ref` followed and message and operation traits merged. Payload and header schemas stay as ordered `*asyncapi.Object` trees, and `Document.Resolver.Deref` follows the `$ref`s inside them. Errors wrap `ctxerrors/commerr` sentinels. Use when Go code needs to read, inspect, validate or generate from an AsyncAPI 3 spec, or is already importing go-asyncapi.
Как установить скилл go-asyncapi?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл go-asyncapi запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic