-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
42 lines (32 loc) · 1001 Bytes
/
main.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
package main
import (
"fmt"
"github.com/kataras/iris/v12"
"github.com/rhernandez-itemsoft/go-helpers/files/toml"
"github.com/rhernandez-itemsoft/go-helpers/iresponse"
"github.com/rhernandez-itemsoft/go-helpers/iresponse/irespmdl"
)
// I18nModel Definición para el config i18n
type I18nModel struct {
Default string
URLParameter string
}
var _iresponse *iresponse.Definition
//SERVER servidor
const SERVER = "localhost:8082"
func main() {
app := iris.New()
fmt.Println(iris.Version)
var i18Conf *I18nModel
toml.Get("./config/i18n.tml", &i18Conf)
fmt.Println("Test I18N ------------------------------")
fmt.Println(i18Conf.Default)
fmt.Println("Test iResponse ------------------------------")
app.Handle("GET", "/", func(ctx iris.Context) {
_iresponse = iresponse.New(ctx)
var response irespmdl.Response = irespmdl.NewResponse()
response.Messages = append(response.Messages, "Probando el http response")
_iresponse.JSON(response)
})
app.Run(iris.Addr(SERVER))
}