/
const.go
75 lines (64 loc) · 1.99 KB
/
const.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* Copyright(c) 2021 Lianjia, Inc. All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package common
const (
// UTF8BOM utf8 file BOM header
UTF8BOM = "\xEF\xBB\xBF"
// DefaultExcelMaxFileSize excel file max size 10MB
DefaultExcelMaxFileSize = 10 * 1024 * 1024
)
// ERROR message
const (
WrongEmptySet = `Empty set`
WrongJSONFormat = `JSON format error, only support string list. e.g., [ ["header", "columns" ], [ "col1", "col2" ] ]`
WrongSQLFormat = `SQL format error, only support basic INSERT/REPLACE syntax`
WrongArgsCount = `arguments count mismatch`
WrongMaskFunc = `wrong mask function`
WrongArgValue = `wrong arguments`
WrongQuotesValue = `ANSI_QUOTES mode values not support double quotes`
WrongColumnsCnt = `columns count mismatch`
WrongLargeThan0 = `n should large than 0`
)
const (
WatermarkPrefix = `
<style type="text/css">
.watermarked {
position: fixed;
overflow: hidden;
}
.watermarked::before {
position: absolute;
top: -75%%;
left: -75%%;
display: block;
width: 150%%;
height: 150%%;
z-index: -1;
transform: rotate(-45deg);
content: attr(data-watermark);
opacity: 0.5;
line-height: 3em;
letter-spacing: 2px;
color: #ccc;
}
</style>
<div class="watermarked" data-watermark="%s">
`
WatermarkSuffix = `
</div>
<script type="text/javascript">
Array.from(document.querySelectorAll('.watermarked')).forEach(function(el) {
el.dataset.watermark = (el.dataset.watermark + ' ').repeat(300);
});
</script>`
)