Documentation
¶
Index ¶
- type ErrorDef
- type Field
- type Manifest
- type Parser
- func (p *Parser) Filter(pluginIDs []string) []*Manifest
- func (p *Parser) Get(pluginID string) (*Manifest, bool)
- func (p *Parser) GetCore() (*Manifest, error)
- func (p *Parser) GetPluginManifests() []*Manifest
- func (p *Parser) List() []*Manifest
- func (p *Parser) LoadDirectory(dir string) error
- func (p *Parser) LoadFile(path string) error
- type Route
- type TypeDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorDef ¶
type ErrorDef struct {
Code int `yaml:"code" json:"code"`
Description string `yaml:"description" json:"description"`
}
ErrorDef represents an error response
type Field ¶
Field represents a parsed field with its type and requirements
func ParseField ¶
ParseField parses a field type string (e.g., "string!", "User[]", "int")
type Manifest ¶
type Manifest struct {
PluginID string `yaml:"plugin_id" json:"plugin_id"`
Version string `yaml:"version" json:"version"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Routes []Route `yaml:"routes" json:"routes"`
Types []TypeDef `yaml:"types,omitempty" json:"types,omitempty"`
BasePath string `yaml:"base_path,omitempty" json:"base_path,omitempty"`
}
Manifest represents a complete API manifest for a plugin or core module
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles loading and parsing manifest files
func (*Parser) GetPluginManifests ¶
GetPluginManifests returns all non-core manifests
func (*Parser) LoadDirectory ¶
LoadDirectory loads all manifest files from a directory
type Route ¶
type Route struct {
Name string `yaml:"name" json:"name"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Method string `yaml:"method" json:"method"`
Path string `yaml:"path" json:"path"`
Request map[string]string `yaml:"request,omitempty" json:"request,omitempty"`
Response map[string]string `yaml:"response,omitempty" json:"response,omitempty"`
RequestType string `yaml:"request_type,omitempty" json:"request_type,omitempty"` // Named type for request (e.g., "SignInRequest")
ResponseType string `yaml:"response_type,omitempty" json:"response_type,omitempty"` // Named type for response (e.g., "SignInResponse")
Params map[string]string `yaml:"params,omitempty" json:"params,omitempty"`
Query map[string]string `yaml:"query,omitempty" json:"query,omitempty"`
Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
Errors []ErrorDef `yaml:"errors,omitempty" json:"errors,omitempty"`
Auth bool `yaml:"auth,omitempty" json:"auth,omitempty"` // Requires authentication
}
Route represents a single API endpoint
func (*Route) GetParamFields ¶
GetParamFields returns parsed path parameter fields
func (*Route) GetQueryFields ¶
GetQueryFields returns parsed query parameter fields
func (*Route) GetRequestFields ¶
GetRequestFields returns parsed request fields
func (*Route) GetResponseFields ¶
GetResponseFields returns parsed response fields