github.com/woremacx/kocha@v0.7.1-0.20150731103243-a5889322afc9/cmd/kocha-build/testdata/config/app.go (about) 1 package config 2 3 import ( 4 "os" 5 "path/filepath" 6 "runtime" 7 "time" 8 9 "github.com/woremacx/kocha" 10 "github.com/woremacx/kocha/log" 11 ) 12 13 var ( 14 AppName = "testappname" 15 AppConfig = &kocha.Config{ 16 Addr: kocha.Getenv("KOCHA_ADDR", "127.0.0.1:9100"), 17 AppPath: rootPath, 18 AppName: AppName, 19 DefaultLayout: "app", 20 Template: &kocha.Template{ 21 PathInfo: kocha.TemplatePathInfo{ 22 Name: AppName, 23 Paths: []string{ 24 filepath.Join(rootPath, "app", "view"), 25 }, 26 }, 27 FuncMap: kocha.TemplateFuncMap{}, 28 }, 29 30 // Logger settings. 31 Logger: &kocha.LoggerConfig{ 32 Writer: os.Stdout, 33 Formatter: &log.LTSVFormatter{}, 34 Level: log.INFO, 35 }, 36 37 Middlewares: []kocha.Middleware{ 38 &kocha.RequestLoggingMiddleware{}, 39 &kocha.SessionMiddleware{ 40 Name: "testappname_session", 41 Store: &kocha.SessionCookieStore{ 42 // AUTO-GENERATED Random keys. DO NOT EDIT. 43 SecretKey: "\xd4(\xd5H`\n\x17\xdbD^Kvk\x1c\xf5\xf7\x99\xf7!\xf7\x88Ll\x94\x9eg\xb5\xf3n#\x81u", 44 SigningKey: "H\xa8\xb2\xa9\xbc\xd5\x18\xd9c~\xf0؉\xb5|\u007f", 45 }, 46 47 // Expiration of session cookie, in seconds, from now. 48 // Persistent if -1, For not specify, set 0. 49 CookieExpires: time.Duration(90) * time.Hour * 24, 50 51 // Expiration of session data, in seconds, from now. 52 // Perssitent if -1, For not specify, set 0. 53 SessionExpires: time.Duration(90) * time.Hour * 24, 54 HttpOnly: false, 55 }, 56 &kocha.DispatchMiddleware{}, 57 }, 58 59 MaxClientBodySize: 1024 * 1024 * 10, // 10MB 60 } 61 62 _, configFileName, _, _ = runtime.Caller(0) 63 rootPath = filepath.Dir(filepath.Join(configFileName, "..")) 64 )