-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgos.gxml
More file actions
executable file
·80 lines (69 loc) · 3.99 KB
/
gos.gxml
File metadata and controls
executable file
·80 lines (69 loc) · 3.99 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<gos>
<!--Stating the deployment type GoS should compile -->
<!-- Curent valid types are webapp,shell and bind -->
<!-- Shell = cli, sort of a GoS(Ghost) in the Shell -->
<deploy>webapp</deploy>
<port>8080</port>
<not_found>/your-404-page</not_found>
<error>/your-500-page</error>
<!-- Using import within different tags will have different results -->
<!-- We going to make the goPkg Mongo Db Driver available to our application -->
<!-- Using <import/> within the <go/> tag is similar to using the import call within a .go file -->
<!-- To be less dramating, GoS will skip packages that it has already imported -->
<!-- Go File output name -->
<output>server_out.go</output>
<!-- exported session fields available to Session -->
<key>a very very very very secret key</key>
<!-- Declare global variables -->
<!-- Contains interfaces and structs
that will be used by the GoS application -->
<header>
<!-- remember to Jumpline when stating methods or different struct attributes, it is vital for our parser \n trick -->
<struct name="UserSpace">
</struct>
<!-- Get holdings method... -->
<object name="UserObject" struct="UserSpace">
</object>
</header>
<methods>
<!-- Vars are defined as usual except within the var attribute for example : -->
<!-- If there is a basic go function : func hackfmt(data string, data2 string) -->
<!-- the attribute names would be called as such var="data string,data2 string" -->
<!-- Similar to a go function decleration-->
<!-- if a method matches the criteria for an interface it will be used as an interface method -->
<!-- To prevent that use the autoface attribute and set it to "false" By default it is true -->
<!-- Use the keep-local="true" attribute to limit a method within a Go file -->
<!-- Sometimes your method will return data -->
<!-- And to do so we will need to add a return var list by using the return attribute -->
<!-- Sometimes the autointerface will reuse the wrong the function, or your interface methods need a bit more distinction -->
<!-- Vis a vis which object types are used in generating these mutating methods -->
<!--Use the limit attribute to narrow down the applicable structs for this method -->
<!-- Use the object attribute to determine the name of the local variable name to be mutated within the function. By default GoS will assume object is the variable name -->
<method name="HelloWorld">
// GoNuts := ""
fmt.Println("Hello World from server")
// response = "Hello world"
</method>
</methods>
<templates>
<!-- Template libraries are useful for expediting page creation and reuse common website elements within this GoS application -->
<!-- Templates are nested and customized with the template function instead of using the normal {{template "Name"}} call you can now use {{Button &{Color:"#fff"}& }}
{{Modal &{Color:"#fff"}& }} -->
<!-- *Notice that special braces are used to initialize the parameters of the struct '&{' and '}&' -->
<!-- <template name="Bootstrap_alert" tmpl="bootstrap/alert" struct="Bootstrap_alert" /> -->
<template name="Header" tmpl="header" struct="" />
<template name="Footer" tmpl="footer" struct="" />
</templates>
<endpoints>
<!-- Depending on your build type the usage of this tag will vary. -->
<!-- For WebServers it will override any request for a given path and run the specified method. No vars or return types are needed for -->
<!-- methods linked to an API call, please keep in mind that you may use w for http.ResponseWriter and r for http.Request . Additional available function variables is params and session. If a function is api listed it will not be used anywhere else.-->
<!-- <end /> is the endpoint tag and has the variables path,method, -->
<!-- Happy trails!!! -->
<!-- <end path="/index/api" method="login" type="POST" ></end> -->
<end path="/api/test" type="GET">
fmt.Println("HelloWorld")
</end>
</endpoints>
</gos>