-
Notifications
You must be signed in to change notification settings - Fork 1
/
vars.go
52 lines (48 loc) · 1.43 KB
/
vars.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
// Copyright 2020 Kamal SHKEIR. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
package ksmux
import (
"html/template"
"net/http"
"time"
"github.com/kamalshkeir/kmap"
)
var (
MEDIA_DIR = "media"
HOST = ""
PORT = ""
ADDRESS = ""
DOMAIN = ""
IsTLS = false
SUBDOMAINS = []string{}
ReadTimeout = 5 * time.Second
WriteTimeout = 20 * time.Second
IdleTimeout = 20 * time.Second
FuncBeforeServerShutdown = func(srv *http.Server) error {
return nil
}
// context
MultipartSize = 10 << 20
beforeRenderHtml = kmap.New[string, func(c *Context, data *map[string]any)]()
rawTemplates = kmap.New[string, *template.Template]()
beforeRenderHtmlSetted = false
// docs
DocsOutJson = "."
DocsEntryFile = "ksmuxdocs/ksmuxdocs.go"
OnDocsGenerationReady = func() {}
withDocs = false
corsEnabled = false
swagFound = false
generateSwaggerJson = false
generateGoComments = true
docsPatterns = []*Route{}
// ctx cookies
COOKIES_Expires = 24 * 7 * time.Hour
COOKIES_SameSite = http.SameSiteStrictMode
COOKIES_HttpOnly = true
COOKIES_SECURE = true
// proxy
proxyUsed bool
proxies = kmap.New[string, http.Handler]()
)