Documentation
¶
Overview ¶
Package lexica provides a Lexicon representation and associated code generators.
Index ¶
- func ManifestIncludes(nsid, name string) bool
- type Catalog
- func (catalog *Catalog) GenerateCallCommands(root string) error
- func (catalog *Catalog) GenerateCheckCommands(root string) error
- func (catalog *Catalog) GenerateXRPCHandlers(root string) error
- func (catalog *Catalog) Load(root string, lint bool) error
- func (catalog *Catalog) LoadLexicon(path string, lint bool) error
- type Def
- type Input
- type Items
- type Lexicon
- type Manifest
- func (manifest *Manifest) AddDependencies(l *Lexicon, def *Def) error
- func (manifest *Manifest) AddDependenciesForArray(l *Lexicon, def *Def) error
- func (manifest *Manifest) AddDependenciesForDef(l *Lexicon, def *Def) error
- func (manifest *Manifest) AddDependenciesForProperties(l *Lexicon, properties map[string]Property) error
- func (manifest *Manifest) AddDependenciesForSubscription(l *Lexicon, def *Def) error
- type Message
- type Output
- type Parameters
- type Permission
- type Property
- type Schema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ManifestIncludes ¶
Types ¶
type Catalog ¶
type Catalog struct {
Lexicons []*Lexicon
}
func NewCatalog ¶
func NewCatalog() *Catalog
func (*Catalog) GenerateCallCommands ¶
func (*Catalog) GenerateCheckCommands ¶
func (*Catalog) GenerateXRPCHandlers ¶
type Def ¶
type Def struct {
Type string `json:"type"`
Description string `json:"description"`
// object
Required []string `json:"required,omitempty"`
Properties map[string]Property `json:"properties,omitempty"`
// query
Parameters *Parameters `json:"parameters,omitempty"`
Output *Output `json:"output,omitempty"`
// procedure
Input *Input `json:"input,omitempty"`
// array
Items *Items `json:"items,omitempty"`
// permission-set
Permissions []*Permission `json:"permissions,omitempty"`
// record
Record *Schema `json:"record,omitempty"`
// subscription
Message *Message `json:"message,omitempty"`
}
func (*Def) ValidateProcedure ¶
func (*Def) ValidateQuery ¶
type Lexicon ¶
type Lexicon struct {
Lexicon int `json:"lexicon"`
Id string `json:"id"`
Description string `json:"description"`
Defs map[string]*Def `json:"defs"`
}
https://atproto.com/specs/lexicon#lexicon-files
func LookupLexicon ¶
type Manifest ¶
type Manifest struct {
IDs []string `json:"ids"`
}
func BuildManifest ¶
func (*Manifest) AddDependencies ¶
func (*Manifest) AddDependenciesForArray ¶
func (*Manifest) AddDependenciesForDef ¶
func (*Manifest) AddDependenciesForProperties ¶
type Parameters ¶
type Permission ¶
type Property ¶
type Property struct {
Type string `json:"type,omitempty"`
Ref string `json:"ref,omitempty"`
Refs []string `json:"refs,omitempty"`
Items *Items `json:"items,omitempty"`
Minimum int64 `json:"minimum,omitempty"`
Maximum int64 `json:"maximum,omitempty"`
Default any `json:"default,omitempty"`
Required []string `json:"required,omitempty"`
Properties map[string]Property `json:"properties,omitempty"`
}
Source Files
¶
- catalog.go
- doc.go
- generate-command-call.go
- generate-command-check.go
- generate-command-internal.go
- generate-helpers.go
- generate-packagecomment.go
- generate-xrpc-def.go
- generate-xrpc-file.go
- generate-xrpc-handlers.go
- generate-xrpc-procedure.go
- generate-xrpc-query.go
- generate-xrpc-resolvers.go
- generate-xrpc-sourcecomment.go
- generate-xrpc-struct.go
- generate-xrpc-subscribe.go
- lexicon.go
- lookup.go
- manifest.go
- validate.go
Click to show internal directories.
Click to hide internal directories.