Documentation
¶
Index ¶
- Constants
- func SupportedClients() []string
- func TypescriptType(t string) string
- type Client
- type Config
- func (c *Config) Clients() (map[string]*Client, error)
- func (c *Config) Data() map[string]string
- func (c *Config) Disable(name string) error
- func (c *Config) Enable(name string) error
- func (c *Config) Enabled(name string) bool
- func (c *Config) Events() (map[string]*Event, bool, error)
- func (c *Config) Groups() (map[string]*Group, error)
- func (c *Config) Join(names ...string) string
- func (c *Config) Models() (map[string]*Model, error)
- func (c *Config) NameHash() string
- func (c *Config) Path(arg ...string) string
- func (c *Config) Queues() (map[string]*Queue, error)
- func (c *Config) Root() string
- func (c *Config) Validate() error
- func (c *Config) Workers() (map[string]*Worker, error)
- type Event
- type Field
- type Group
- func (g *Group) AddRoute(r *Route)
- func (g *Group) AllModels() []string
- func (g *Group) Camel() string
- func (g *Group) CombinedRoutes() []*Route
- func (g *Group) GetModels() []string
- func (g *Group) HasResponse() bool
- func (g *Group) TypescriptImports() []string
- func (g *Group) TypescriptPackages() []string
- func (g *Group) TypescriptType() string
- type Model
- type Param
- type Queue
- type Route
- func (r *Route) AddParam(p *Param)
- func (r *Route) Camel() string
- func (r *Route) ClientMethod() string
- func (r *Route) ClientPath() string
- func (r *Route) Create() bool
- func (r *Route) Crud() bool
- func (r *Route) Delete() bool
- func (r *Route) GetModel() *Param
- func (r *Route) HasModel() bool
- func (r *Route) HasParams() bool
- func (r *Route) Index() bool
- func (r *Route) PathParams() []*Param
- func (r *Route) QueryParams() []*Param
- func (r *Route) QueryString() string
- func (r *Route) Settings() bool
- func (r *Route) Show() bool
- func (r *Route) TypescriptMethod() string
- func (r *Route) TypescriptPath() string
- func (r *Route) TypescriptResult() string
- func (r *Route) Update() bool
- type Worker
Constants ¶
View Source
const VERSION = "v0.17.0"
VERSION is the version of the application automatically managed by pre-commit githook
Variables ¶
This section is empty.
Functions ¶
func SupportedClients ¶ added in v0.13.0
func SupportedClients() []string
func TypescriptType ¶ added in v0.14.3
Types ¶
type Client ¶ added in v0.13.0
type Config ¶
type Config struct {
File string `yaml:"-"`
Version string `yaml:"version,omitempty"`
Name string `yaml:"name,omitempty"`
Repo string `yaml:"repo,omitempty"`
Package string `yaml:"package,omitempty"`
Output string `yaml:"output,omitempty"`
Plugins struct {
Models bool `yaml:"models"`
Routes bool `yaml:"routes"`
Workers bool `yaml:"workers"`
Cache bool `yaml:"cache"`
Events bool `yaml:"events"`
Clients bool `yaml:"clients"`
APM bool `yaml:"apm"`
} `yaml:"plugins"`
Definitions struct {
Models string `yaml:"models,omitempty"`
Routes string `yaml:"routes,omitempty"`
Events string `yaml:"events,omitempty"`
Workers string `yaml:"workers,omitempty"`
Queues string `yaml:"queues,omitempty"`
Clients string `yaml:"clients,omitempty"`
} `yaml:"definitions,omitempty"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
type Event ¶ added in v0.10.0
type Event struct {
Name string `yaml:"name,omitempty"`
Channel string `yaml:"channel,omitempty"`
Receiver bool `yaml:"receiver"`
Concurrency int `yaml:"concurrency,omitempty"`
ExistingPayload string `yaml:"existing_payload,omitempty"`
ProxyTo string `yaml:"proxy_to,omitempty"`
ProxyType string `yaml:"proxy_type,omitempty"`
Fields []*Field `yaml:"fields,omitempty"` // create type
}
type Field ¶ added in v0.10.0
type Field struct {
Name string `yaml:"name,omitempty"`
Type string `yaml:"type,omitempty"`
Json string `yaml:"json,omitempty"`
Bson string `yaml:"bson,omitempty"`
Xml string `yaml:"xml,omitempty"`
Index bool `yaml:"index,omitempty"`
IndexDesc bool `yaml:"index_desc,omitempty"`
}
func (*Field) TypescriptType ¶ added in v0.14.3
type Group ¶ added in v0.10.0
type Group struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Rest bool `json:"rest,omitempty" yaml:"rest,omitempty"`
Model string `json:"model,omitempty" yaml:"model,omitempty"`
Routes []*Route `json:"routes,omitempty" yaml:"routes,omitempty"`
}
Group corresponds to a Group of routes
func (*Group) CombinedRoutes ¶ added in v0.10.0
func (*Group) HasResponse ¶ added in v0.14.9
func (*Group) TypescriptImports ¶ added in v0.14.9
func (*Group) TypescriptPackages ¶ added in v0.14.12
TODO: maybe make this capture all the types (map[string][]string) and then we can stub the types in the generated typescript package
func (*Group) TypescriptType ¶ added in v0.14.3
type Model ¶ added in v0.10.0
type Model struct {
Name string `yaml:"name,omitempty"`
Type string `yaml:"type,omitempty"`
QueryDefaults map[string]interface{} `yaml:"query_defaults,omitempty"`
Indexes []string `yaml:"indexes,omitempty"`
Search []string `yaml:"search,omitempty"`
Imports []string `yaml:"imports,omitempty"`
Fields []*Field `yaml:"fields,omitempty"`
}
func (*Model) IndexesDescriptor ¶ added in v0.14.27
func (*Model) QueryDefaultsString ¶ added in v0.10.2
func (*Model) SearchDescriptor ¶ added in v0.16.1
func (*Model) TypescriptImports ¶ added in v0.14.14
type Param ¶ added in v0.10.0
type Param struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Default string `json:"default,omitempty" yaml:"default,omitempty"`
Query bool `json:"query,omitempty" yaml:"query,omitempty"`
Bind bool `json:"bind,omitempty" yaml:"bind,omitempty"`
}
func (*Param) HasSupportedDefault ¶ added in v0.14.12
func (*Param) IsSupported ¶ added in v0.14.12
func (*Param) TypescriptType ¶ added in v0.14.3
type Route ¶ added in v0.10.0
type Route struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
Method string `json:"method,omitempty" yaml:"method,omitempty"`
Params []*Param `json:"params,omitempty" yaml:"params,omitempty"`
Result string `json:"result,omitempty" yaml:"result,omitempty"`
}
func (*Route) ClientMethod ¶ added in v0.13.0
func (*Route) ClientPath ¶ added in v0.13.0
func (*Route) PathParams ¶ added in v0.13.0
func (*Route) QueryParams ¶ added in v0.13.0
func (*Route) QueryString ¶ added in v0.14.3
func (*Route) TypescriptMethod ¶ added in v0.14.3
func (*Route) TypescriptPath ¶ added in v0.14.3
func (*Route) TypescriptResult ¶ added in v0.14.3
Click to show internal directories.
Click to hide internal directories.