Documentation
¶
Overview ¶
Package lexgen generates Go types and client functions from ATProto Lexicon schemas.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
Generate produces Go source files from parsed lexicon schemas. Returns a map of file path → file contents.
func TypeName ¶
TypeName returns the Go type name for a def given an NSID and def name. "app.bsky.feed.post", "main" → "FeedPost" "app.bsky.feed.post", "replyRef" → "FeedPost_ReplyRef" "app.bsky.feed.defs", "postView" → "FeedDefs_PostView"
func WriteFiles ¶
WriteFiles writes all generated files to disk, creating directories as needed.
Types ¶
type Config ¶
type Config struct {
Packages []PackageConfig `json:"packages"`
}
Config controls code generation.
type PackageConfig ¶
type PackageConfig struct {
Prefix string `json:"prefix"` // NSID prefix, e.g. "app.bsky"
Package string `json:"package"` // Go package name, e.g. "bsky"
OutDir string `json:"outDir"` // output directory, e.g. "api/bsky"
Import string `json:"import"` // full import path, e.g. "github.com/jcalabro/atmos/api/bsky"
}
PackageConfig maps an NSID prefix to a Go package.
Click to show internal directories.
Click to hide internal directories.