config

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func TypescriptType(t string) string

Types

type Client added in v0.13.0

type Client struct {
	Language    string `yaml:"language"`
	Destination string `yaml:"destination,omitempty"`
}

func (*Client) Output added in v0.14.3

func (c *Client) Output() string

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

func (*Config) Clients added in v0.13.0

func (c *Config) Clients() (map[string]*Client, error)

func (*Config) Data added in v0.10.0

func (c *Config) Data() map[string]string

func (*Config) Disable added in v0.10.0

func (c *Config) Disable(name string) error

func (*Config) Enable added in v0.10.0

func (c *Config) Enable(name string) error

func (*Config) Enabled added in v0.10.0

func (c *Config) Enabled(name string) bool

func (*Config) Events added in v0.10.0

func (c *Config) Events() (map[string]*Event, bool, error)

func (*Config) Groups added in v0.10.3

func (c *Config) Groups() (map[string]*Group, error)

func (*Config) Join added in v0.13.0

func (c *Config) Join(names ...string) string

func (*Config) Models

func (c *Config) Models() (map[string]*Model, error)

func (*Config) NameHash added in v0.14.0

func (c *Config) NameHash() string

func (*Config) Path

func (c *Config) Path(arg ...string) string

func (*Config) Queues added in v0.11.0

func (c *Config) Queues() (map[string]*Queue, error)

func (*Config) Root

func (c *Config) Root() string

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) Workers added in v0.10.3

func (c *Config) Workers() (map[string]*Worker, error)

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
}

func (*Event) Camel added in v0.10.0

func (e *Event) Camel() string

func (*Event) Create added in v0.10.0

func (e *Event) Create() bool

func (*Event) Payload added in v0.10.0

func (e *Event) Payload() string

func (*Event) Sender added in v0.10.0

func (e *Event) Sender() bool

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) BsonTag added in v0.10.0

func (f *Field) BsonTag() string

func (*Field) Camel added in v0.10.0

func (f *Field) Camel() string

func (*Field) JsonTag added in v0.10.0

func (f *Field) JsonTag() string

func (*Field) TypescriptType added in v0.14.3

func (f *Field) TypescriptType() string

func (*Field) XmlTag added in v0.17.0

func (f *Field) XmlTag() string

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) AddRoute added in v0.10.0

func (g *Group) AddRoute(r *Route)

func (*Group) AllModels added in v0.14.12

func (g *Group) AllModels() []string

func (*Group) Camel added in v0.10.0

func (g *Group) Camel() string

func (*Group) CombinedRoutes added in v0.10.0

func (g *Group) CombinedRoutes() []*Route

func (*Group) GetModels added in v0.14.7

func (g *Group) GetModels() []string

func (*Group) HasResponse added in v0.14.9

func (g *Group) HasResponse() bool

func (*Group) TypescriptImports added in v0.14.9

func (g *Group) TypescriptImports() []string

func (*Group) TypescriptPackages added in v0.14.12

func (g *Group) TypescriptPackages() []string

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

func (g *Group) TypescriptType() string

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) Camel added in v0.10.0

func (m *Model) Camel() string

func (*Model) IndexesDescriptor added in v0.14.27

func (m *Model) IndexesDescriptor() string

func (*Model) Model added in v0.10.0

func (m *Model) Model() bool

func (*Model) QueryDefaultsString added in v0.10.2

func (m *Model) QueryDefaultsString() string

func (*Model) SearchDescriptor added in v0.16.1

func (m *Model) SearchDescriptor() string

func (*Model) Struct added in v0.10.0

func (m *Model) Struct() bool

func (*Model) TypescriptImports added in v0.14.14

func (m *Model) TypescriptImports() []string

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) Camel added in v0.13.0

func (p *Param) Camel() string

func (*Param) HasSupportedDefault added in v0.14.12

func (p *Param) HasSupportedDefault() bool

func (*Param) IsSupported added in v0.14.12

func (p *Param) IsSupported() bool

func (*Param) SafeName added in v0.14.20

func (p *Param) SafeName() string

func (*Param) TypeCamel added in v0.10.0

func (p *Param) TypeCamel() string

func (*Param) TypeNew added in v0.14.11

func (p *Param) TypeNew() string

func (*Param) TypescriptType added in v0.14.3

func (p *Param) TypescriptType() string

type Queue added in v0.11.0

type Queue struct {
	Name        string `yaml:"name,omitempty"`
	Concurrency int    `yaml:"concurrency,omitempty"`
	Buffer      int    `yaml:"buffer,omitempty"`
	Interval    int    `yaml:"interval,omitempty"`
}

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) AddParam added in v0.10.0

func (r *Route) AddParam(p *Param)

func (*Route) Camel added in v0.10.0

func (r *Route) Camel() string

func (*Route) ClientMethod added in v0.13.0

func (r *Route) ClientMethod() string

func (*Route) ClientPath added in v0.13.0

func (r *Route) ClientPath() string

func (*Route) Create added in v0.13.0

func (r *Route) Create() bool

func (*Route) Crud added in v0.10.0

func (r *Route) Crud() bool

func (*Route) Delete added in v0.13.0

func (r *Route) Delete() bool

func (*Route) GetModel added in v0.14.3

func (r *Route) GetModel() *Param

func (*Route) HasModel added in v0.14.3

func (r *Route) HasModel() bool

func (*Route) HasParams added in v0.13.0

func (r *Route) HasParams() bool

func (*Route) Index added in v0.12.0

func (r *Route) Index() bool

func (*Route) PathParams added in v0.13.0

func (r *Route) PathParams() []*Param

func (*Route) QueryParams added in v0.13.0

func (r *Route) QueryParams() []*Param

func (*Route) QueryString added in v0.14.3

func (r *Route) QueryString() string

func (*Route) Settings added in v0.13.0

func (r *Route) Settings() bool

func (*Route) Show added in v0.13.0

func (r *Route) Show() bool

func (*Route) TypescriptMethod added in v0.14.3

func (r *Route) TypescriptMethod() string

func (*Route) TypescriptPath added in v0.14.3

func (r *Route) TypescriptPath() string

func (*Route) TypescriptResult added in v0.14.3

func (r *Route) TypescriptResult() string

func (*Route) Update added in v0.13.0

func (r *Route) Update() bool

type Worker added in v0.10.0

type Worker struct {
	Name     string   `yaml:"name,omitempty"`
	Queue    string   `yaml:"queue,omitempty"`
	Schedule string   `yaml:"schedule,omitempty"`
	Fields   []*Field `yaml:"fields,omitempty"`
}

func (*Worker) Camel added in v0.10.0

func (w *Worker) Camel() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL