Skip to content

Commit cf7115e

Browse files
vvelikodnyVitaly Velikodny
andauthored
add options: browser_cache_settings, webp, rewrite, redirect_http_to_https, gzipOn, cors (#9)
Co-authored-by: Vitaly Velikodny <vitaly.velikodny@gcorelabs.com>
1 parent 9753162 commit cf7115e

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

gcore/options.go

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
package gcore
22

33
type Options struct {
4-
EdgeCacheSettings *EdgeCacheSettings `json:"edge_cache_settings,omitempty"`
5-
HostHeader *HostHeader `json:"hostHeader,omitempty"`
4+
EdgeCacheSettings *EdgeCacheSettings `json:"edge_cache_settings,omitempty"`
5+
BrowserCacheSettings *BrowserCacheSettings `json:"browser_cache_settings,omitempty"`
6+
HostHeader *HostHeader `json:"hostHeader,omitempty"`
7+
Webp *Webp `json:"webp,omitempty"`
8+
Rewrite *Rewrite `json:"rewrite,omitempty"`
9+
RedirectHttpToHttps *RedirectHttpToHttps `json:"redirect_http_to_https,omitempty"`
10+
GzipOn *GzipOn `json:"gzipOn,omitempty"`
11+
Cors *Cors `json:"cors,omitempty"`
612
}
713

814
type EdgeCacheSettings struct {
@@ -16,3 +22,36 @@ type HostHeader struct {
1622
Enabled bool `json:"enabled"`
1723
Value string `json:"value"`
1824
}
25+
26+
type BrowserCacheSettings struct {
27+
Enabled bool `json:"enabled"`
28+
Value string `json:"value"`
29+
}
30+
31+
type Webp struct {
32+
Enabled bool `json:"enabled"`
33+
JPGQuality int `json:"jpg_quality"`
34+
PNGQuality int `json:"png_quality"`
35+
PNGLossless bool `json:"png_lossless"`
36+
}
37+
38+
type Rewrite struct {
39+
Enabled bool `json:"enabled"`
40+
Body string `json:"body"`
41+
Flag string `json:"flag"`
42+
}
43+
44+
type RedirectHttpToHttps struct {
45+
Enabled bool `json:"enabled"`
46+
Value bool `json:"value"`
47+
}
48+
49+
type GzipOn struct {
50+
Enabled bool `json:"enabled"`
51+
Value bool `json:"value"`
52+
}
53+
54+
type Cors struct {
55+
Enabled bool `json:"enabled"`
56+
Value []string `json:"value"`
57+
}

0 commit comments

Comments
 (0)