Versions in this module Expand all Collapse all v0 v0.0.9 Apr 3, 2025 Changes in this version + const BUILD_FAIL + const MODELER_FAIL + const TEMPLATE_ENGINE_BASE_DIR + const TEMPLATE_ENGINE_EXT_NAME + const TEMPLATE_ENGINE_FAIL + const TEMPLATE_ENGINE_PARTIALS_DIR + const TEMPLATE_ENGINE_PORT + const TEMPLATE_ENGINE_TIMEOUT + const TuiStandardMenu + const TuiStandardMenuHelp + func RunBuilder(in io.Reader, out io.Writer, eout io.Writer, args []string) int + func RunGenerator(in io.Reader, out io.Writer, eout io.Writer, args []string) int + func RunModeler(in io.Reader, out io.Writer, eout io.Writer, args []string) int + func RunNewtConfig(in io.Reader, out io.Writer, eout io.Writer, args []string, verbose bool) int + func RunNewtServices(in io.Reader, out io.Writer, eout io.Writer, args []string, verbose bool) int + func RunRouter(in io.Reader, out io.Writer, eout io.Writer, args []string, dryRun bool, ...) int + func RunTemplateEngine(in io.Reader, out io.Writer, eout io.Writer, args []string, port int, ...) int + func TmplFooterPartial(out io.Writer, copyrightYear string, copyrightLink string, ...) error + func TmplGen(out io.Writer, model *models.Model, action string) error + func TmplHeadPartial(out io.Writer, defaultTitle string, cssPath string) error + func TmplHeaderPartial(out io.Writer, defaultHeaderLink string, defaultHeaderLinkTitle string, ...) error + func TmplNavPartial(out io.Writer, navElement string) error + func UnmarshalAST(src []byte, ast *AST) error + type AST struct + AppMetadata *AppMetadata + Models []*models.Model + Routes []*Route + Services []*Service + Templates []*Template + func LoadAST(configFName string) (*AST, error) + func NewAST() *AST + func (ast *AST) AddModel(model *models.Model) error + func (ast *AST) Check(buf io.Writer) bool + func (ast *AST) Encode() ([]byte, error) + func (ast *AST) GetAllTemplates() []string + func (ast *AST) GetModelById(id string) (*models.Model, bool) + func (ast *AST) GetModelIds() []string + func (ast *AST) GetPrimaryTemplates() []string + func (ast *AST) GetRouteIds() []string + func (ast *AST) GetService(appName string) *Service + func (ast *AST) GetTemplateByPrimary(fName string) (*Template, bool) + func (ast *AST) GetTemplateIds() []string + func (ast *AST) HasChanges() bool + func (ast *AST) RemoveModelById(id string) error + func (ast *AST) RemoveRouteById(id string) error + func (ast *AST) RemoveService(appName string) error + func (ast *AST) RemoveTemplateById(id string) error + func (ast *AST) SaveAs(configName string) error + func (ast *AST) UpdateModel(id string, model *models.Model) error + type AppMetadata struct + AppName string + AppTitle string + CSSPath string + ContactAddress string + ContactEMail string + ContactPhone string + CopyrightLink string + CopyrightText string + CopyrightYear string + HeaderLink string + HeaderText string + LicenseLink string + LicenseText string + LogoLink string + LogoText string + type BodyGen func(io.Writer, *models.Model) error + type Generator struct + AppMetadata *AppMetadata + Models []*models.Model + Namespace string + Options map[string]interface{} + PostgREST *Service + Postgres *Service + TemplateEngine *Service + func (g *Generator) Generate(generatorName string, modelId string, action string) error + type Route struct + Debug bool + Description string + Id string + Options map[string]interface{} + Pattern string + Pipeline []*RouteService + Vars []string + func (nr *Route) Check(buf io.Writer) bool + func (nr *Route) Handler(w http.ResponseWriter, r *http.Request) + func (nr *Route) ResolvePattern(r *http.Request) map[string]interface{} + func (nr *Route) ResolveRoute() error + func (nr *Route) RunPipeline(w http.ResponseWriter, r *http.Request, env map[string]interface{}) ([]byte, int, string, error) + type RouteService struct + Description string + Service string + Timeout time.Duration + func (s *RouteService) MakeRequest(env map[string]interface{}, input []byte, contentType string, debug bool) ([]byte, int, string, error) + type Router struct + Htdocs string + Port int + Routes []*Route + func NewRouter(ast *AST) (*Router, error) + func (rtr *Router) Check(buf io.Writer) bool + func (rtr *Router) GetRouteIds() []string + func (rtr *Router) ListenAndServe() error type Service + AppName string + AppPath string + BaseDir string + CName string + ConfPath string + DSN string + Environment []string + ExtName string + Htdocs string + Namespace string + Options map[string]interface{} + PartialsDir string + Port int + func NewServices() []*Service + type Template struct + BaseDir string + Body map[string]interface{} + Debug bool + Description string + Document map[string]interface{} + ExtName string + Id string + PartialsDir string + Pattern string + Template string + Tmpl *raymond.Template + Vars []string + func (t *Template) Handler(w http.ResponseWriter, r *http.Request) + func (t *Template) ResolvePath() error + func (t *Template) ResolveTemplate() error + func (tmpl *Template) Check(buf io.Writer) bool + type TemplateEngine struct + BaseDir string + ExtName string + PartialsDir string + Port int + Templates []*Template + Timeout time.Duration + func NewTemplateEngine(ast *AST) (*TemplateEngine, error) + func (tEng *TemplateEngine) Check(buf io.Writer) bool + func (te *TemplateEngine) ListenAndServe() error v0.0.8 Apr 16, 2024 Changes in this version + const CHECK_FAIL + const CONFIG + const DATA_ERROR + const DECODE_ERROR + const GENERATOR_FAIL + const HANDLER + const INIT_FAIL + const LicenseText + const MUSTACHE_FAIL + const MUSTACHE_PORT + const MUSTACHE_TIMEOUT + const NEWT_FAIL + const OK + const POSTGREST_FAIL + const POSTGREST_PORT + const POSTGRES_PORT + const READ_ERROR + const RESOLVE + const ROUTER_FAIL + const ROUTER_PORT + const ReleaseDate + const ReleaseHash + const SERVER_ERROR + const SWS_FAIL + const SWS_HTDOCS + const SWS_PORT + const TEMPLATE_ERROR + const UNSUPPORTED_ACTION + const Version + func ConfigUnmarshal(src []byte, cfg *Config) error + func FmtHelp(src string, appName string, version string, releaseDate string, ...) string + func MDisplayElemGen(elem *Element) string + func MInputElemGen(elem *Element) string + func MTmplGen(out io.Writer, action string, model *NewtModel) error + func NewtStaticFileServer(port int, htdocs string, verbose bool) error + func PatternKeys(p string) []string + func RunMustacheCLI(in io.Reader, out io.Writer, eout io.Writer, args []string, ...) int + func RunNewt(in io.Reader, out io.Writer, eout io.Writer, args []string, verbose bool) int + func RunNewtApplications(in io.Reader, out io.Writer, eout io.Writer, args []string, verbose bool) int + func RunNewtCheckYAML(in io.Reader, out io.Writer, eout io.Writer, args []string, verbose bool) int + func RunNewtGenerator(in io.Reader, out io.Writer, eout io.Writer, args []string) int + func RunNewtInit(in io.Reader, out io.Writer, eout io.Writer, args []string, verbose bool) int + func RunNewtMustache(in io.Reader, out io.Writer, eout io.Writer, args []string, port int, ...) int + func RunNewtRouter(in io.Reader, out io.Writer, eout io.Writer, args []string, dryRun bool, ...) int + func RunStaticWebServer(in io.Reader, out io.Writer, eout io.Writer, args []string, port int, ...) int + type Application struct + AppPath string + ConfPath string + DSN string + Htdocs string + Namespace string + Port int + Timeout time.Duration + type Applications struct + Environment []string + NewtGenerator *Application + NewtMustache *Application + NewtRouter *Application + Options map[string]string + PostgREST *Application + Postgres *Application + type Config struct + Applications *Applications + Models []*NewtModel + Routes []*NewtRoute + Templates []*MustacheTemplate + func LoadConfig(configFName string) (*Config, error) + func (cfg *Config) GetModelById(id string) (*NewtModel, bool) + func (cfg *Config) GetModelIds() []string + func (cfg *Config) GetModelNames() []string + type Element struct + Attributes map[string]string + Id string + Type string + Validations map[string]interface{} + type Logger struct + After bool + Verbose bool + func NewLogger(handlerToWrap http.Handler) *Logger + func (l *Logger) ServeHTTP(w http.ResponseWriter, r *http.Request) + type MustacheTemplate struct + Debug bool + Description string + Options map[string]string + Partials []string + Pattern string + Template string + Tmpl *mustache.Template + Vars []string + Voc map[string]interface{} + Vocabulary string + func (mt *MustacheTemplate) Handler(w http.ResponseWriter, r *http.Request) + func (mt *MustacheTemplate) LoadVocabulary() error + func (mt *MustacheTemplate) ResolvePath() error + func (mt *MustacheTemplate) ResolveTemplate() error + type NewtGenerator struct + Models []*NewtModel + Namespace string + Options map[string]string + PostgREST *Application + Postgres *Application + func NewGenerator(cfg *Config) (*NewtGenerator, error) + func (g *NewtGenerator) Generate(generatorName string, action string, modelId string) error + type NewtModel struct + Assignees []string + Attributes map[string]interface{} + Body []*Element + Description string + Id string + Labels []string + Name string + Projects []string + Title string + func (m *NewtModel) GetElementById(id string) (*Element, bool) + func (m *NewtModel) GetElementIds() []string + type NewtMustache struct + Options map[string]string + Port int + Templates []*MustacheTemplate + Timeout time.Duration + func NewNewtMustache(cfg *Config) (*NewtMustache, error) + func (nm *NewtMustache) ListenAndServe() error + type NewtRoute struct + Debug bool + Description string + Id string + Options map[string]string + Pattern string + Pipeline []*Service + Vars []string + func (nr *NewtRoute) Handler(w http.ResponseWriter, r *http.Request) + func (nr *NewtRoute) ResolvePattern(r *http.Request) map[string]string + func (nr *NewtRoute) ResolveRoute() error + func (nr *NewtRoute) RunPipeline(w http.ResponseWriter, r *http.Request, env map[string]string) ([]byte, int, string, error) + type NewtRouter struct + Htdocs string + Port int + Routes []*NewtRoute + func NewNewtRouter(cfg *Config) (*NewtRouter, error) + func (rtr *NewtRouter) ListenAndServe() error + type PartialGen func(io.Writer, *NewtModel) error + type Service struct + Description string + Service string + Timeout time.Duration + func (s *Service) MakeRequest(env map[string]string, input []byte, contentType string, debug bool) ([]byte, int, string, error)