-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.go
101 lines (92 loc) · 1.92 KB
/
types.go
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package samb
// Project has your samb
// directives.
type Project struct {
Server Server
Require, Import []string
// Provider defines the providers
// to be used by HTTP routes.
Provider []Global
Package string
Author string
Packages []string
Routes Routes
Templates Templates
Global []Global
}
type Global struct {
Name, Type, Return, Comment string
}
// Server specifies the generated
// web server properties.
type Server struct {
Host, Key string
Port string
Webroot string
Require []string
// Routes field will enable
// route nesting.
Routes Routes
Start Go
// Functions to be invoked
// on panic.
Recover Go
Init Go
Shutdown Go
}
// Routes holds a group of
// HTTP routes.
type Routes struct {
Route []Route
Provide []string
Doc Documentation
}
// Route specifies the contract
// needed to be met by a request,
// and the handler (Go code) to be executed.
type Route struct {
Method, Path string
// Provide is a list of
// provider names to be used by request.
Provide []string
Route []Route
Handler string
// Go specifies Go code
// to be ran prior to invocation
// of handler. This code must respect
// the scope of a Go HTTP handler function,
// with variables r and w in scope.
Go Go
Doc Documentation
// Strict specifies
// if route should only be invoked
// if the request path matches this
// routes' path
Strict bool
// Require will import and nest the
// routes from the specified SAMB sources.
Require []string
}
// Array of Go statements
// to be executed.
type Go struct {
Do []string
}
// Documentation will be used
// to generate HTML documentation
// of your code.
type Documentation struct {
// Comment is used
// with documentation
// generation.
Comment string
// Alias specifies how the resource
// should be used.
Alias string
}
type Templates struct {
Template []Template
}
type Template struct {
FilePath, Type, Name string
}