-
Notifications
You must be signed in to change notification settings - Fork 130
/
const.go
179 lines (158 loc) · 5.15 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
package curl
/*
#include <curl/curl.h>
#include "compat.h"
*/
import "C"
// for GlobalInit(flag)
const (
GLOBAL_SSL = C.CURL_GLOBAL_SSL
GLOBAL_WIN32 = C.CURL_GLOBAL_WIN32
GLOBAL_ALL = C.CURL_GLOBAL_ALL
GLOBAL_NOTHING = C.CURL_GLOBAL_NOTHING
GLOBAL_DEFAULT = C.CURL_GLOBAL_DEFAULT
)
// CURLMcode
const (
M_CALL_MULTI_PERFORM = C.CURLM_CALL_MULTI_PERFORM
// M_OK = C.CURLM_OK
M_BAD_HANDLE = C.CURLM_BAD_HANDLE
M_BAD_EASY_HANDLE = C.CURLM_BAD_EASY_HANDLE
M_OUT_OF_MEMORY = C.CURLM_OUT_OF_MEMORY
M_INTERNAL_ERROR = C.CURLM_INTERNAL_ERROR
M_BAD_SOCKET = C.CURLM_BAD_SOCKET
M_UNKNOWN_OPTION = C.CURLM_UNKNOWN_OPTION
)
// for multi.Setopt(flag, ...)
const (
MOPT_SOCKETFUNCTION = C.CURLMOPT_SOCKETFUNCTION
MOPT_SOCKETDATA = C.CURLMOPT_SOCKETDATA
MOPT_PIPELINING = C.CURLMOPT_PIPELINING
MOPT_TIMERFUNCTION = C.CURLMOPT_TIMERFUNCTION
MOPT_TIMERDATA = C.CURLMOPT_TIMERDATA
MOPT_MAXCONNECTS = C.CURLMOPT_MAXCONNECTS
)
// CURLSHcode
const (
// SHE_OK = C.CURLSHE_OK
SHE_BAD_OPTION = C.CURLSHE_BAD_OPTION
SHE_IN_USE = C.CURLSHE_IN_USE
SHE_INVALID = C.CURLSHE_INVALID
SHE_NOMEM = C.CURLSHE_NOMEM
)
// for share.Setopt(flat, ...)
const (
SHOPT_SHARE = C.CURLSHOPT_SHARE
SHOPT_UNSHARE = C.CURLSHOPT_UNSHARE
SHOPT_LOCKFUNC = C.CURLSHOPT_LOCKFUNC
SHOPT_UNLOCKFUNC = C.CURLSHOPT_UNLOCKFUNC
SHOPT_USERDATA = C.CURLSHOPT_USERDATA
)
// for share.Setopt(SHOPT_SHARE/SHOPT_UNSHARE, flag)
const (
LOCK_DATA_SHARE = C.CURL_LOCK_DATA_SHARE
LOCK_DATA_COOKIE = C.CURL_LOCK_DATA_COOKIE
LOCK_DATA_DNS = C.CURL_LOCK_DATA_DNS
LOCK_DATA_SSL_SESSION = C.CURL_LOCK_DATA_SSL_SESSION
LOCK_DATA_CONNECT = C.CURL_LOCK_DATA_CONNECT
)
// for VersionInfo(flag)
const (
VERSION_FIRST = C.CURLVERSION_FIRST
VERSION_SECOND = C.CURLVERSION_SECOND
VERSION_THIRD = C.CURLVERSION_THIRD
// VERSION_FOURTH = C.CURLVERSION_FOURTH
VERSION_LAST = C.CURLVERSION_LAST
VERSION_NOW = C.CURLVERSION_NOW
)
// for VersionInfo(...).Features mask flag
const (
VERSION_IPV6 = C.CURL_VERSION_IPV6
VERSION_KERBEROS4 = C.CURL_VERSION_KERBEROS4
VERSION_SSL = C.CURL_VERSION_SSL
VERSION_LIBZ = C.CURL_VERSION_LIBZ
VERSION_NTLM = C.CURL_VERSION_NTLM
VERSION_GSSNEGOTIATE = C.CURL_VERSION_GSSNEGOTIATE
VERSION_DEBUG = C.CURL_VERSION_DEBUG
VERSION_ASYNCHDNS = C.CURL_VERSION_ASYNCHDNS
VERSION_SPNEGO = C.CURL_VERSION_SPNEGO
VERSION_LARGEFILE = C.CURL_VERSION_LARGEFILE
VERSION_IDN = C.CURL_VERSION_IDN
VERSION_SSPI = C.CURL_VERSION_SSPI
VERSION_CONV = C.CURL_VERSION_CONV
VERSION_CURLDEBUG = C.CURL_VERSION_CURLDEBUG
VERSION_TLSAUTH_SRP = C.CURL_VERSION_TLSAUTH_SRP
VERSION_NTLM_WB = C.CURL_VERSION_NTLM_WB
)
// for OPT_READFUNCTION, return a int flag
const (
READFUNC_ABORT = C.CURL_READFUNC_ABORT
READFUNC_PAUSE = C.CURL_READFUNC_PAUSE
)
// for easy.Setopt(OPT_HTTP_VERSION, flag)
const (
HTTP_VERSION_NONE = C.CURL_HTTP_VERSION_NONE
HTTP_VERSION_1_0 = C.CURL_HTTP_VERSION_1_0
HTTP_VERSION_1_1 = C.CURL_HTTP_VERSION_1_1
)
// for easy.Setopt(OPT_PROXYTYPE, flag)
const (
PROXY_HTTP = C.CURLPROXY_HTTP /* added in 7.10, new in 7.19.4 default is to use CONNECT HTTP/1.1 */
PROXY_HTTP_1_0 = C.CURLPROXY_HTTP_1_0 /* added in 7.19.4, force to use CONNECT HTTP/1.0 */
PROXY_SOCKS4 = C.CURLPROXY_SOCKS4 /* support added in 7.15.2, enum existed already in 7.10 */
PROXY_SOCKS5 = C.CURLPROXY_SOCKS5 /* added in 7.10 */
PROXY_SOCKS4A = C.CURLPROXY_SOCKS4A /* added in 7.18.0 */
// Use the SOCKS5 protocol but pass along the host name rather than the IP address.
PROXY_SOCKS5_HOSTNAME = C.CURLPROXY_SOCKS5_HOSTNAME
)
// for easy.Setopt(OPT_SSLVERSION, flag)
const (
SSLVERSION_DEFAULT = C.CURL_SSLVERSION_DEFAULT
SSLVERSION_TLSv1 = C.CURL_SSLVERSION_TLSv1
SSLVERSION_SSLv2 = C.CURL_SSLVERSION_SSLv2
SSLVERSION_SSLv3 = C.CURL_SSLVERSION_SSLv3
)
// for easy.Setopt(OPT_TIMECONDITION, flag)
const (
TIMECOND_NONE = C.CURL_TIMECOND_NONE
TIMECOND_IFMODSINCE = C.CURL_TIMECOND_IFMODSINCE
TIMECOND_IFUNMODSINCE = C.CURL_TIMECOND_IFUNMODSINCE
TIMECOND_LASTMOD = C.CURL_TIMECOND_LASTMOD
)
// for easy.Setopt(OPT_NETRC, flag)
const (
NETRC_IGNORED = C.CURL_NETRC_IGNORED
NETRC_OPTIONAL = C.CURL_NETRC_OPTIONAL
NETRC_REQUIRED = C.CURL_NETRC_REQUIRED
)
// for easy.Setopt(OPT_FTP_CREATE_MISSING_DIRS, flag)
const (
FTP_CREATE_DIR_NONE = C.CURLFTP_CREATE_DIR_NONE
FTP_CREATE_DIR = C.CURLFTP_CREATE_DIR
FTP_CREATE_DIR_RETRY = C.CURLFTP_CREATE_DIR_RETRY
)
// for easy.Setopt(OPT_IPRESOLVE, flag)
const (
IPRESOLVE_WHATEVER = C.CURL_IPRESOLVE_WHATEVER
IPRESOLVE_V4 = C.CURL_IPRESOLVE_V4
IPRESOLVE_V6 = C.CURL_IPRESOLVE_V6
)
// for easy.Setopt(OPT_SSL_OPTIONS, flag)
const (
SSLOPT_ALLOW_BEAST = 1
)
// for easy.Pause(flat)
const (
PAUSE_RECV = C.CURLPAUSE_RECV
PAUSE_RECV_CONT = C.CURLPAUSE_RECV_CONT
PAUSE_SEND = C.CURLPAUSE_SEND
PAUSE_SEND_CONT = C.CURLPAUSE_SEND_CONT
PAUSE_ALL = C.CURLPAUSE_ALL
PAUSE_CONT = C.CURLPAUSE_CONT
)
// for multi.Info_read()
const (
CURLMSG_NONE = C.CURLMSG_NONE
CURLMSG_DONE = C.CURLMSG_DONE
CURLMSG_LAST = C.CURLMSG_LAST
)