-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPILOT.txt
80 lines (53 loc) · 1.51 KB
/
PILOT.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Possíveis ORMs
https://github.com/astaxie/beego/tree/master/orm
https://gorm.io/docs/sql_builder.html
Proposta:
- Ser um framework prático e super opinativo,
trazendo consigo o react, golang, Gin, goorm,
parceljs, bulmajs
- Geradores:
--- O framework deve incluir os geradores básicos para
desenvolver o CRUD do projeto, já utilizando as boas práticas
de javascript
Objetivo inicial:
- Criar um framework que seja capaz de criar um blog em 5 minutos
// define the template
const someTemplate = `insert into {{.Schema}}.{{.Table}} (field1, field2)
values
{{ range .Rows }}
({{.Field1}}, {{.Field2}}),
{{end}};`
// wrap your values and execute the template
data := struct {
Schema string
Table string
Rows []MyCustomType
}{
schema,
table,
someListOfMyCustomType,
}
t, err := template.New("new_tmpl").Parse(someTemplate)
if err != nil {
panic(err)
}
// working buffer
buf := &bytes.Buffer{}
err = t.Execute(buf, data)
https://www.calhoun.io/intro-to-templates-p3-functions/
https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/07.4.html
Keep templates on binary file
https://github.com/gobuffalo/packr
# import regex
import(.|)\((.|\n)+\)
# get import content regex
import(.+)*\((.|\n)+?\)
# get DrawRoutes content
func.+DrawRoutes.+{(.|\n)+?\n}
## v2
func.+DrawRoutes.+{\n((.|\n)+?)}
# get module name
module (.+)\n
import(.|\n)+\"(.|\n)\)
# models automigrate
\.AutoMigrate\((.+)\)