mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 00:02:43 +02:00
add webhook recent deliveries
This commit is contained in:
1 parent
fc2d0e5470
commit
23f42d92c9
18 files changed
+474
-233
No files matched your search
@@ -112,7 +112,7 @@ func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _confAppIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x5a\x4b\x8f\xe3\x56\x76\xde\xf3\x57\x5c\x97\xe3\xb8\x1d\x48\xaa\x97\xfb\xe1\xb2\x2b\x69\x95\x44\xa9\x38\xad\x97\x49\xa9\xcb\xed\x46\x81\xc5\x22\xaf\x24\x76\x51\xa4\x9a\x97\xac\x6a\x19\x59\x8c\x91\x45\x80\x2c\x93\x41\xb2\x09\x82\x64\x11\x04\x98\x3c\x90\x41\x36\x33\x13\x64\x65\x64\xdf\xfd\x1f\x0c\xcf\xe4\x5f\xe4\x3b\xe7\x92\x12\x55\x5d\xee\xf1\x4c\x32\xe8\x46\x89\xba\x8f\x73\xef\xf9\xee\x79\x7c\xe7\x52\xef\x8b\x81\xf9\xd4\xb4\x05\xff\xe9\x0f\xdb\x56\xe7\x99\x18\x9f\x5a\x8e\xe8\x58\x3d\xd3\x78\x5f\x8c\x7a\x66\xd3\x31\x45\xbf\xf9\xc4\x14\xad\xd3\xe6\xa0\x6b\x3a\x62\x38\x10\xad\xa1\x6d\x9b\xce\x68\x38\x68\x5b\x83\xae\x68\x4d\x9c\xf1\xb0\x8f\xc6\x41\xc7\xea\xea\x99\xc6\xa7\xa2\xb9\x5c\x8a\xd8\x5b\x48\x91\xcd\xbd\x4c\xa8\x79\x72\xa3\x44\x12\x0b\x79\x2d\xd3\x95\x58\x7a\x33\x74\x84\x59\x24\x8d\xe6\x68\xe4\x0e\x9a\x7d\x53\x1c\x8b\x6e\x32\x53\x47\xf8\x2b\xba\x61\x26\x1c\x99\x5e\x87\xbe\x84\xa4\xd6\xdc\x8b\x31\x1c\x6d\xe1\x54\xac\x92\x5c\xa4\x79\x2c\xa2\xc4\xf7\xa2\x68\x65\xd8\x93\x81\x3b\x71\xb0\xfb\x63\x31\x0b\x33\x8c\x36\xc3\x6c\x2e\x53\xb1\x13\xc8\xeb\x9d\x9a\xd8\x59\xa6\x49\xb0\x23\x12\x34\x64\x52\x65\x68\x09\xe4\xd4\xcb\x23\xc8\x52\x7a\x0c\x4b\x80\xea\xb4\x01\x7c\x37\x8c\xe7\xa9\x5c\x26\x2a\xcc\x92\x74\x75\x6e\xd8\xc3\xe1\x58\x1c\x1b\x4e\xcb\xb6\x46\x63\x77\xfc\x6c\x44\xc3\x2e\x3d\x35\xc7\xb8\x3c\x3c\xc7\x7a\x83\x7c\x71\x89\xf5\x92\x29\x24\xaa\x5c\x2a\xad\xaf\x97\x4a\xd6\x59\x06\x22\x8c\xa1\xb7\x64\x95\x0d\xcb\x71\x26\xa6\x3b\x6a\x76\x81\x9b\x3b\x98\xf4\x21\x6c\x7f\x0f\xa2\x14\x94\x95\xe9\xb9\x31\xb2\x87\xe3\x61\x6b\xd8\x43\xfb\x3c\xcb\x96\x46\x7b\xd8\x6f\x5a\x03\x7c\x63\x75\xe7\x89\xca\x78\x47\xee\xc4\xa6\x21\x1f\xdc\x2b\xc7\x7f\xa4\x8e\x76\x77\x3f\xb8\xa7\x87\xe3\xcb\x07\xf7\x4e\xc7\xe3\x91\x3b\x1a\xda\xe3\x8f\xd4\xae\xc1\x5f\x9a\xed\x36\x50\x32\xd6\x1d\x10\x70\xb8\xb7\xb7\x07\x15\xda\xa1\xf2\x2e\x23\x29\x1c\xe7\x54\x4c\xa5\x97\xe5\xd8\xfc\xcd\x5c\xc6\x22\x4e\xa0\xc9\xb5\x17\x46\xd4\x6d\xb4\x2d\xa7\x79\xd2\x33\x5d\x1a\x76\x2c\xa6\x5e\xa4\xa4\x81\xe7\x52\xd8\xc1\x41\x45\x54\xab\x3d\xa0\xa3\x8e\x49\xfb\xe2\x0c\x16\x49\x20\x8d\x61\xa7\xd3\xb3\x06\x66\x09\xb8\x16\x52\x0a\xb6\x87\x93\xb1\x69\xbb\xbd\x61\x77\xdd\xf5\xa9\xe8\xca\x58\xa6\x5e\x06\x38\x33\xb9\x54\x47\x68\xf9\x03\xe1\x07\x80\x33\x9b\xef\x66\xc9\xee\x0c\x36\xb3\xeb\xe7\x2a\x4b\x16\xbb\x04\x99\xe2\x01\x0d\x6e\x17\xbe\x4c\x33\x51\xf7\xbd\xe3\x2c\xcd\xa5\xa8\x07\x39\x04\x85\x49\x7c\xfc\xe8\xe1\x83\xbd\xf9\xde\x62\x4f\x89\x3a\x61\x7a\xbc\x58\xd1\x47\x43\xbe\xf2\x16\xcb\x48\x36\xfc\x64\x61\x7c\x0a\x39\xc3\x54\x4c\xd3\x64\x21\x3c\xd1\x58\x4e\x5f\x89\x69\x08\xc5\xe4\xab\x65\x92\x66\x38\x56\xee\x81\xa9\x89\xb3\x30\x0e\xc8\xb8\x69\xb1\x70\x1a\xfa\x7a\xaf\x09\x30\xbc\x17\x24\x90\x42\x20\x4e\x93\x74\x26\x33\x91\x25\xc5\x7c\x9e\xb8\x4c\xc3\x6b\x1a\x7c\x25\x57\x1f\x69\xbd\x92\xa5\x8c\x95\x8a\xc4\xf2\xca\x57\xfb\x07\xa2\x0e\xf0\x48\x2a\xaf\x5e\x4f\xf2\xac\xf8\x26\x17\xa2\x1e\x27\x98\xa6\x7e\xd8\x2c\x8c\x2c\x27\x51\x87\xa2\x87\x40\x2a\xa3\x65\xda\x63\x97\xfc\x15\x70\x57\x21\xdc\x2d\x97\x31\x9e\x98\xcf\xee\x1c\x50\x48\xc4\xf2\x93\xe5\x12\xd6\x1f\xe1\xac\x23\xf2\x81\x4c\x02\x41\x52\xca\x8b\x03\xa0\x00\xb8\x7d\x8d\x1b\x9d\x17\x86\x57\xbc\x8f\x21\x40\x2b\x99\x1a\xc0\x22\xe7\xa7\x66\xf9\x4a\xfa\x39\x00\x36\x9c\x71\x73\x6c\xb5\x5c\xb6\xf7\x51\x73\x0c\x9b\xd3\x51\x25\x22\x88\x71\x8a\xc5\xa2\xdd\x2f\xad\x91\x50\xf9\x92\x60\x35\xcc\x01\x1b\x12\xb7\x6d\x4c\xa8\x87\xcd\x84\xf1\x4c\x47\x1d\x1c\x05\x8e\x24\xae\x47\xc9\x6c\x86\x63\xcc\xe1\x7a\xaa\x26\x7c\x2f\x16\x97\x52\xec\xcc\x93\x85\xd4\xe1\x02\x07\x15\xe1\x10\x77\x8c\x5e\x93\xc3\x1c\x79\x2d\xe1\x40\x23\xe0\xb1\x81\x97\x79\x88\x03\xf2\xbc\x12\x72\x16\x2b\xf5\x32\xe2\xa0\x03\x6b\x9a\xa5\x52\x69\x49\x68\x0c\x33\x79\x88\x8e\x30\xfb\x50\x51\x04\x4b\x85\x3f\x4f\x28\xb8\xb5\x4f\xca\x98\xc2\x73\x8d\xd3\xa1\x43\xae\xb4\x7f\xf0\xb0\xb1\x87\x7f\xfb\x47\x87\x87\x7b\x0f\x8c\x22\x3c\x92\x49\x1b\x45\xac\x4b\x93\x24\x33\x46\x4d\xc7\x39\x6b\x33\x2e\x1d\x5a\xa8\xb2\x6c\x1c\xad\x6a\x42\x96\xa1\x50\x3b\x25\xed\x2c\x95\x2f\xf3\x30\x2d\x54\x44\xc8\x09\xa7\xab\xfa\x34\x8f\xa2\x1d\x78\x72\x6f\x1d\x06\xf5\xf8\x52\x6c\xb9\x7f\x96\x6a\xe8\xa3\x10\xa4\x3f\x3b\x59\x23\xb8\x04\x1c\x5e\xb0\x08\xe3\x73\x8e\x64\x7e\x9e\x86\x19\x42\xa7\x35\xc0\x09\xf6\x7a\x70\xe7\xd6\x93\xca\x61\xbc\xf7\x9e\x4e\x24\x3a\xcf\x8c\x87\xe2\x89\x69\x8e\xc4\xb3\xe1\xc4\x16\xac\x5b\xbb\x39\x6e\x0a\xa7\xd9\x31\xdf\x7b\xcf\x70\xcc\x96\x6d\x8e\x5d\x58\x21\x04\xbc\xf7\xfe\xe3\x4e\xdb\x3c\xb3\xf1\xff\x0f\xff\xe8\x1e\xd9\x42\x9e\x25\x74\x8c\xb0\xf7\x54\x2e\x24\x87\xe1\xc0\x83\x53\x20\x80\x58\x03\xd7\x36\xfb\x66\xff\x04\xf1\xa4\xdd\x7c\xe6\x60\xfe\x43\xa3\x35\x1c\x3e\xb1\x4c\x4e\x17\x15\x48\x5d\xef\x46\x2a\x3a\xd4\xa2\x7b\x3d\xaf\x3a\x26\x8c\xfd\x54\x06\xa1\x46\xc5\xa6\x24\xa6\xc8\x81\x93\x57\x2b\xe1\xe5\x40\x39\xce\x4a\xab\x9c\x4b\x2f\xc0\x46\x38\xf5\xc1\x21\xc8\xbe\xf8\x8b\x61\x53\x92\x75\x10\xfd\xed\xe1\x17\xcf\xdc\xe6\x64\x7c\x6a\x0e\x60\xe0\x30\xf2\xe1\x3a\x85\x7d\x51\x3f\x33\x4f\xa8\xab\x4e\x0d\x45\x62\x80\xa1\x9c\x1b\Line truncated
|
||||
var _confAppIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x5a\x4b\x8f\xe3\x56\x76\xde\xf3\x57\x5c\x97\xe3\xb8\x1d\x48\xaa\x97\xfb\xe1\xb2\x2b\x69\x95\x44\xa9\x38\xad\x97\x49\xa9\xcb\xed\x46\x81\xc5\x22\xaf\x24\x76\x51\xa4\x9a\x97\xac\x6a\x19\x59\x8c\x91\x45\x80\x2c\x93\x41\xb2\x09\x82\x64\x11\x04\x98\x3c\x90\x41\x36\x33\x13\x64\x65\x64\xdf\xfd\x1f\x0c\xcf\xe4\x5f\xe4\x3b\xe7\x92\x12\x55\x5d\xee\xf1\x4c\x32\xe8\x46\x89\xba\x8f\x73\xef\xf9\xee\x79\x7c\xe7\x52\xef\x8b\x81\xf9\xd4\xb4\x05\xff\xe9\x0f\xdb\x56\xe7\x99\x18\x9f\x5a\x8e\xe8\x58\x3d\xd3\x78\x5f\x8c\x7a\x66\xd3\x31\x45\xbf\xf9\xc4\x14\xad\xd3\xe6\xa0\x6b\x3a\x62\x38\x10\xad\xa1\x6d\x9b\xce\x68\x38\x68\x5b\x83\xae\x68\x4d\x9c\xf1\xb0\x8f\xc6\x41\xc7\xea\xea\x99\xc6\xa7\xa2\xb9\x5c\x8a\xd8\x5b\x48\x91\xcd\xbd\x4c\xa8\x79\x72\xa3\x44\x12\x0b\x79\x2d\xd3\x95\x58\x7a\x33\x74\x84\x59\x24\x8d\xe6\x68\xe4\x0e\x9a\x7d\x53\x1c\x8b\x6e\x32\x53\x47\xf8\x2b\xba\x61\x26\x1c\x99\x5e\x87\xbe\x84\xa4\xd6\xdc\x8b\x31\x1c\x6d\xe1\x54\xac\x92\x5c\xa4\x79\x2c\xa2\xc4\xf7\xa2\x68\x65\xd8\x93\x81\x3b\x71\xb0\xfb\x63\x31\x0b\x33\x8c\x36\xc3\x6c\x2e\x53\xb1\x13\xc8\xeb\x9d\x9a\xd8\x59\xa6\x49\xb0\x23\x12\x34\x64\x52\x65\x68\x09\xe4\xd4\xcb\x23\xc8\x52\x7a\x0c\x4b\x80\xea\xb4\x01\x7c\x37\x8c\xe7\xa9\x5c\x26\x2a\xcc\x92\x74\x75\x6e\xd8\xc3\xe1\x58\x1c\x1b\x4e\xcb\xb6\x46\x63\x77\xfc\x6c\x44\xc3\x2e\x3d\x35\xc7\xb8\x3c\x3c\xc7\x7a\x83\x7c\x71\x89\xf5\x92\x29\x24\xaa\x5c\x2a\xad\xaf\x97\x4a\xd6\x59\x06\x22\x8c\xa1\xb7\x64\x95\x0d\xcb\x71\x26\xa6\x3b\x6a\x76\x81\x9b\x3b\x98\xf4\x21\x6c\x7f\x0f\xa2\x14\x94\x95\xe9\xb9\x31\xb2\x87\xe3\x61\x6b\xd8\x43\xfb\x3c\xcb\x96\x46\x7b\xd8\x6f\x5a\x03\x7c\x63\x75\xe7\x89\xca\x78\x47\xee\xc4\xa6\x21\x1f\xdc\x2b\xc7\x7f\xa4\x8e\x76\x77\x3f\xb8\xa7\x87\xe3\xcb\x07\xf7\x4e\xc7\xe3\x91\x3b\x1a\xda\xe3\x8f\xd4\xae\xc1\x5f\x9a\xed\x36\x50\x32\xd6\x1d\x10\x70\xb8\xb7\xb7\x07\x15\xda\xa1\xf2\x2e\x23\x29\x1c\xe7\x54\x4c\xa5\x97\xe5\xd8\xfc\xcd\x5c\xc6\x22\x4e\xa0\xc9\xb5\x17\x46\xd4\x6d\xb4\x2d\xa7\x79\xd2\x33\x5d\x1a\x76\x2c\xa6\x5e\xa4\xa4\x81\xe7\x52\xd8\xc1\x41\x45\x54\xab\x3d\xa0\xa3\x8e\x49\xfb\xe2\x0c\x16\x49\x20\x8d\x61\xa7\xd3\xb3\x06\x66\x09\xb8\x16\x52\x0a\xb6\x87\x93\xb1\x69\xbb\xbd\x61\x77\xdd\xf5\xa9\xe8\xca\x58\xa6\x5e\x06\x38\x33\xb9\x54\x47\x68\xf9\x03\xe1\x07\x80\x33\x9b\xef\x66\xc9\xee\x0c\x36\xb3\xeb\xe7\x2a\x4b\x16\xbb\x04\x99\xe2\x01\x0d\x6e\x17\xbe\x4c\x33\x51\xf7\xbd\xe3\x2c\xcd\xa5\xa8\x07\x39\x04\x85\x49\x7c\xfc\xe8\xe1\x83\xbd\xf9\xde\x62\x4f\x89\x3a\x61\x7a\xbc\x58\xd1\x47\x43\xbe\xf2\x16\xcb\x48\x36\xfc\x64\x61\x7c\x0a\x39\xc3\x54\x4c\xd3\x64\x21\x3c\xd1\x58\x4e\x5f\x89\x69\x08\xc5\xe4\xab\x65\x92\x66\x38\x56\xee\x81\xa9\x89\xb3\x30\x0e\xc8\xb8\x69\xb1\x70\x1a\xfa\x7a\xaf\x09\x30\xbc\x17\x24\x90\x42\x20\x4e\x93\x74\x26\x33\x91\x25\xc5\x7c\x9e\xb8\x4c\xc3\x6b\x1a\x7c\x25\x57\x1f\x69\xbd\x92\xa5\x8c\x95\x8a\xc4\xf2\xca\x57\xfb\x07\xa2\x0e\xf0\x48\x2a\xaf\x5e\x4f\xf2\xac\xf8\x26\x17\xa2\x1e\x27\x98\xa6\x7e\xd8\x2c\x8c\x2c\x27\x51\x87\xa2\x87\x40\x2a\xa3\x65\xda\x63\x97\xfc\x15\x70\x57\x21\xdc\x2d\x97\x31\x9e\x98\xcf\xee\x1c\x50\x48\xc4\xf2\x93\xe5\x12\xd6\x1f\xe1\xac\x23\xf2\x81\x4c\x02\x41\x52\xca\x8b\x03\xa0\x00\xb8\x7d\x8d\x1b\x9d\x17\x86\x57\xbc\x8f\x21\x40\x2b\x99\x1a\xc0\x22\xe7\xa7\x66\xf9\x4a\xfa\x39\x00\x36\x9c\x71\x73\x6c\xb5\x5c\xb6\xf7\x51\x73\x0c\x9b\xd3\x51\x25\x22\x88\x71\x8a\xc5\xa2\xdd\x2f\xad\x91\x50\xf9\x92\x60\x35\xcc\x01\x1b\x12\xb7\x6d\x4c\xa8\x87\xcd\x84\xf1\x4c\x47\x1d\x1c\x05\x8e\x24\xae\x47\xc9\x6c\x86\x63\xcc\xe1\x7a\xaa\x26\x7c\x2f\x16\x97\x52\xec\xcc\x93\x85\xd4\xe1\x02\x07\x15\xe1\x10\x77\x8c\x5e\x93\xc3\x1c\x79\x2d\xe1\x40\x23\xe0\xb1\x81\x97\x79\x88\x03\xf2\xbc\x12\x72\x16\x2b\xf5\x32\xe2\xa0\x03\x6b\x9a\xa5\x52\x69\x49\x68\x0c\x33\x79\x88\x8e\x30\xfb\x50\x51\x04\x4b\x85\x3f\x4f\x28\xb8\xb5\x4f\xca\x98\xc2\x73\x8d\xd3\xa1\x43\xae\xb4\x7f\xf0\xb0\xb1\x87\x7f\xfb\x47\x87\x87\x7b\x0f\x8c\x22\x3c\x92\x49\x1b\x45\xac\x4b\x93\x24\x33\x46\x4d\xc7\x39\x6b\x33\x2e\x1d\x5a\xa8\xb2\x6c\x1c\xad\x6a\x42\x96\xa1\x50\x3b\x25\xed\x2c\x95\x2f\xf3\x30\x2d\x54\x44\xc8\x09\xa7\xab\xfa\x34\x8f\xa2\x1d\x78\x72\x6f\x1d\x06\xf5\xf8\x52\x6c\xb9\x7f\x96\x6a\xe8\xa3\x10\xa4\x3f\x3b\x59\x23\xb8\x04\x1c\x5e\xb0\x08\xe3\x73\x8e\x64\x7e\x9e\x86\x19\x42\xa7\x35\xc0\x09\xf6\x7a\x70\xe7\xd6\x93\xca\x61\xbc\xf7\x9e\x4e\x24\x3a\xcf\x8c\x87\xe2\x89\x69\x8e\xc4\xb3\xe1\xc4\x16\xac\x5b\xbb\x39\x6e\x0a\xa7\xd9\x31\xdf\x7b\xcf\x70\xcc\x96\x6d\x8e\x5d\x58\x21\x04\xbc\xf7\xfe\xe3\x4e\xdb\x3c\xb3\xf1\xff\x0f\xff\xe8\x1e\xd9\x42\x9e\x25\x74\x8c\xb0\xf7\x54\x2e\x24\x87\xe1\xc0\x83\x53\x20\x80\x58\x03\xd7\x36\xfb\x66\xff\x04\xf1\xa4\xdd\x7c\xe6\x60\xfe\x43\xa3\x35\x1c\x3e\xb1\x4c\x4e\x17\x15\x48\x5d\xef\x46\x2a\x3a\xd4\xa2\x7b\x3d\xaf\x3a\x26\x8c\xfd\x54\x06\xa1\x46\xc5\xa6\x24\xa6\xc8\x81\x93\x57\x2b\xe1\xe5\x40\x39\xce\x4a\xab\x9c\x4b\x2f\xc0\x46\x38\xf5\xc1\x21\xc8\xbe\xf8\x8b\x61\x53\x92\x75\x10\xfd\xed\xe1\x17\xcf\xdc\xe6\x64\x7c\x6a\x0e\x60\xe0\x30\xf2\xe1\x3a\x85\x7d\x51\x3f\x33\x4f\xa8\xab\x4e\x0d\x45\x62\x80\xa1\x9c\x1b\Line truncated
|
||||
|
||||
func confAppIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -127,7 +127,7 @@ func confAppIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/app.ini", size: 9508, mode: os.FileMode(420), modTime: time.Unix(1439835459, 0)}
|
||||
info := bindataFileInfo{name: "conf/app.ini", size: 9569, mode: os.FileMode(420), modTime: time.Unix(1440682245, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
@@ -772,7 +772,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdb\x48\x92\xe7\xff\x78\x0a\xb4\x37\x7c\x76\x47\xc8\x74\x74\x4f\xdc\x47\x4c\xd8\xee\x93\xa5\xf6\xc7\xac\x65\x69\x2d\x79\xe6\xe6\x1c\x0e\x34\x48\x40\x24\x46\x24\xc0\x06\x40\xd1\x9a\x8d\x8d\xb8\xd7\xb8\xd7\xbb\x27\xb9\xcc\x5f\x66\xd6\x07\x00\xca\xf6\xec\xc6\xdd\x3f\x64\xa1\x2a\xeb\x2b\x2b\x2b\x2b\x2b\x2b\x2b\x2b\xdf\x6e\xb3\xa2\xec\x16\xe9\xf3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\x93\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\x6e\x6f\xab\x45\x99\x24\xab\x66\x53\x12\xe8\x1b\xfa\x4b\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe2\xd4\xc2\x49\xf9\x65\xbb\x6e\x5a\x06\xfa\x55\x42\xc9\xaa\x5c\x6f\x39\x0f\xfd\x25\x5d\xb5\xac\xb3\xaa\xa6\xcf\x4b\x0a\xa5\x6f\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x04\x44\x58\xfa\x1f\xd3\x9f\xeb\x22\xbd\xec\xcb\x6d\xfa\xac\xdb\xe4\xeb\xf5\x8b\xbc\x43\x96\xbe\x4c\xf3\xc5\xa2\xd9\xd5\xfd\xb3\xa7\x92\x20\x85\x37\xbb\xde\x4a\x3f\xdf\xf5\x12\xb7\xdb\x5a\xd4\xc7\x6d\xd2\x96\xcb\x8a\x3a\xd6\x52\xd4\x07\x0d\x26\xfb\x72\xde\x55\x3d\x37\xfa\x2f\x12\x4a\x6e\xcb\xb6\xab\x1a\x6e\xcf\x9f\x25\x94\x6c\xf3\x25\x03\x5c\xd0\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x2b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x9d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc1\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\x3e\x52\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x09\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x17\x1a\x24\x44\x64\xfd\xdd\xb6\x04\x1e\x9e\x5c\x51\x28\x59\xe4\xdb\x7e\xb1\xca\xb9\xad\x12\x4a\x08\x68\xdb\x10\x42\x9a\xf6\x0e\x70\xf6\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe9\x3c\xf8\x4c\x36\x55\xdb\x36\x8c\xdf\x33\x04\x12\xea\x71\xc6\xe5\x50\xcc\x7b\xc2\x44\x50\x0a\xa7\x6c\xaa\x65\x2b\xa8\xe4\xc4\x33\x7c\x71\x29\x9c\x76\xdd\xb4\x37\x9a\xf0\x8a\x83\x83\xac\xd4\x08\x4d\x8d\xeb\xcf\x6b\x42\xbe\xa6\x9e\xe1\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x8b\xf0\x42\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x4b\x46\xf6\xb1\x44\xa5\x97\x1a\x95\x04\x69\x2e\xee\xae\xd9\xb9\xe1\xa4\xf8\xbf\xd2\x67\x7a\x21\x9f\x92\x16\x64\x42\xa2\xcb\xc9\x3d\xe9\xb2\xeb\xb2\x2c\xa4\x2f\x5d\xfa\x8a\xc2\xc9\x76\xb7\x5e\x13\xd6\x7e\xdf\x95\x5d\xcf\x99\x2e\xe8\x9b\xfa\x2f\xdf\x49\xd5\x75\x14\xa0\xe8\xb7\x08\x24\x34\x74\xf5\x02\x9d\x39\x41\x20\x49\x3e\x75\x65\xde\x2e\x56\x9f\x13\xf9\x47\x5b\x39\xc0\xb4\x77\x68\x50\x99\x90\x94\x88\xa4\x06\xab\x20\x59\x34\x05\x7f\x9c\xd0\x1f\x15\x5d\xd5\x5d\x4f\x33\xee\x73\xa2\x01\x06\x93\x90\x0c\x40\x5f\xf5\xc0\x82\x46\x62\xfa\x76\x3c\x82\xe9\xab\xaa\xed\xfa\x27\x7d\x45\xc4\xfa\x61\x57\x27\xdc\x3f\x9a\x6d\x59\x31\x37\x26\xf4\xba\x21\x14\x21\xba\xa5\xfe\x9d\xdd\x5d\xfe\xcb\xbb\xa3\xf4\x82\x38\xd1\xb2\x2d\x29\x9c\x52\x19\xf4\x47\x79\xfe\x30\x4b\x28\x97\xd5\x74\x9a\xf7\xf9\x3c\xef\x4a\x8f\x56\x4e\x14\xea\x76\x69\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\xf5\x77\x6a\x86\x50\x19\x3a\xaf\x5c\x19\xef\x79\x72\x51\x3c\x33\x35\x64\xbe\x58\x97\x1c\x4f\x45\xa5\x6f\xdf\xbf\x3f\x3f\x7d\x99\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\x34\xa7\x5a\xa2\x84\x94\x08\x5b\x3a\x37\x4b\xba\x6e\x4d\x73\x1f\xe8\xbd\xbc\x7c\x97\x9e\x31\x8a\xb7\x79\xbf\x42\x43\xfa\x55\xd2\xfd\xbe\x66\x14\xb9\x0a\xaf\x56\x65\x0a\x2a\x03\x50\x73\x6d\xf8\x48\x0b\x6d\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\xdf\x65\x9a\x59\xcb\x1b\x42\x4a\x11\x44\x3a\x75\xd3\xa7\xf3\x32\x45\x9e\x59\x92\x58\x83\x0d\xbb\xc7\xdb\xed\xba\x5a\xc8\x5c\x7f\x2d\x69\x1e\xd1\xbc\x82\x28\x96\x42\x38\x20\xca\xd2\x02\x74\x11\x7b\xe6\xf9\x90\x46\x0c\x04\xf9\x57\x25\x31\xc0\xd5\x6e\x29\x6c\x6f\xdd\xec\x8a\x1f\x40\xa9\xd6\x7a\x4f\xa8\xe9\x87\x86\x1a\x0c\xec\x38\x00\x5f\xc5\x31\x51\x1c\x2f\x5a\x6d\xb9\x69\x88\xaf\x38\x62\xaf\x88\xa0\xf6\x15\x25\x52\x4f\xbb\xfc\x96\xe6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x05\xd3\xd4\xd8\xd1\x72\x21\x64\x41\x04\x2a\xa4\x61\x71\xf1\x18\x00\x6a\xb3\x23\x6a\x5a\x51\x61\xbc\x18\xf1\xca\x49\x45\x4e\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xa7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xbe\xa6\x56\x75\x44\x15\x6f\xd2\xc5\xba\x21\x92\xfa\xf8\xe1\x5d\xc7\x04\xb3\xca\xb6\x4d\x8b\x65\x8e\x92\x2e\x28\xe8\xe2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\x6b\xbf\xaa\x88\x03\x00\xed\x9c\x83\x57\x73\x8a\xa5\x2a\x76\x1d\x0d\xe1\x51\x4a\x24\x4c\x3d\x20\x94\x81\x00\xb8\x0f\x45\xd5\xe5\x73\x1a\x7b\x06\xbf\xa6\x65\x6b\xd7\x12\x59\xad\xfa\x7e\x6b\x35\xbf\xb9\xba\xba\x90\xaa\x5d\xec\x7d\x75\xe7\x01\x65\x60\x0c\xd6\xbc\xf0\xd6\x69\x53\xcf\x40\x24\xbb\x76\x3d\xa0\x1f\xea\xab\xa5\x1c\xc0\x0b\x37\xe1\x29\xff\x5c\x7a\xf4\x00\xcf\x1d\x49\x27\x7b\x50\x13\xe1\xb8\xc4\x02\x48\x44\xdd\x6c\xb9\xdc\x80\xaa\xcf\x35\xc2\x93\x32\x16\x4d\x97\x2e\x4b\x27\xa5\x42\xf6\x09\xd8\xff\x86\x3a\xac\x6c\xe4\xf2\x8c\xd0\x00\x5e\x82\xd8\xeb\xb6\xd9\x50\xec\x2b\xfa\xf3\x11\xbe\xf9\x67\x5c\x1e\x60\xf2\xa2\x20\xfe\xd6\x1d\xa5\x1f\x5e\x9d\xa4\xff\xf9\x0f\x3f\xff\x3c\x4b\xdf\xf6\x3c\x13\x99\x38\xff\xc6\x44\x45\x41\x59\xc3\x1d\x28\xb1\x8c\x9e\xe8\xee\x01\xcf\xac\x07\xe9\x3Line truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xfd\x72\xdb\x48\x92\xe7\xff\x78\x0a\xb4\x37\x7c\x76\x47\xc8\x74\x74\x4f\xdc\x47\x4c\xd8\xee\x93\xa5\xf6\xc7\xac\x65\x69\x2d\x79\xe6\xe6\x1c\x0e\x34\x48\x40\x24\x46\x24\xc0\x06\x40\xd1\x9a\x8d\x8d\xb8\xd7\xb8\xd7\xbb\x27\xb9\xcc\x5f\x66\xd6\x07\x00\xca\xf6\xec\xc6\xdd\x3f\x64\xa1\x2a\xeb\x2b\x2b\x2b\x2b\x2b\x2b\x2b\x2b\xdf\x6e\xb3\xa2\xec\x16\xe9\xf3\xf4\x38\xdd\xe6\x55\xbd\x2e\xbb\x2e\xed\xca\xf5\xf5\x93\x55\xd3\xf5\x65\x91\xbe\xae\x7a\xfa\x6e\x6f\xab\x45\x99\x24\xab\x66\x53\x12\xe8\x1b\xfa\x4b\x8a\xbc\x5b\xcd\x9b\xbc\x2d\x28\xe2\xd4\xc2\x49\xf9\x65\xbb\x6e\x5a\x06\xfa\x55\x42\xc9\xaa\x5c\x6f\x39\x0f\xfd\x25\x5d\xb5\xac\xb3\xaa\xa6\xcf\x4b\x0a\xa5\x6f\xeb\xa4\x6b\x16\x55\xbe\xce\x82\x04\x44\x58\xfa\x1f\xd3\x9f\xeb\x22\xbd\xec\xcb\x6d\xfa\xac\xdb\xe4\xeb\xf5\x8b\xbc\x43\x96\xbe\x4c\xf3\xc5\xa2\xd9\xd5\xfd\xb3\xa7\x92\x20\x85\x37\xbb\xde\x4a\x3f\xdf\xf5\x12\xb7\xdb\x5a\xd4\xc7\x6d\xd2\x96\xcb\x8a\x3a\xd6\x52\xd4\x07\x0d\x26\xfb\x72\xde\x55\x3d\x37\xfa\x2f\x12\x4a\x6e\xcb\xb6\xab\x1a\x6e\xcf\x9f\x25\x94\x6c\xf3\x25\x03\x5c\xd0\x5f\xd2\x97\x9b\xed\x3a\x47\x86\x2b\x0d\x26\xeb\xbc\x5e\xee\x04\xe6\x9d\x06\x93\x45\x5b\x52\x52\x56\x97\x7b\x8a\x3d\xc1\x47\x4a\x1f\xb3\xd9\x2c\xd9\x11\x4e\xb3\x6d\xdb\x5c\x57\xeb\x32\xcb\xeb\x22\xdb\x08\xd6\x3e\x52\x7c\xaa\xf1\x29\xc5\xa7\x1c\x8f\x6e\x94\x05\x21\x28\xcb\x3b\xed\x0b\x0d\x0d\xe1\x2b\xef\x12\x14\x55\xe7\x1b\xcb\xcd\xc1\xa4\xdc\xe4\xd5\x9a\x07\xe1\x09\x07\xa8\xf1\x5d\xb7\x6f\x30\x54\x17\x1a\x24\x44\x64\xfd\xdd\xb6\x04\x1e\x9e\x5c\x51\x28\x59\xe4\xdb\x7e\xb1\xca\xb9\xad\x12\x4a\x08\x68\xdb\x10\x42\x9a\xf6\x0e\x70\xf6\x91\x34\xed\x32\xaf\xab\xbf\xe7\xbd\x20\xe9\x3c\xf8\x4c\x36\x55\xdb\x36\x8c\xdf\x33\x04\x12\xea\x71\xc6\xe5\x50\xcc\x7b\xc2\x44\x50\x0a\xa7\x6c\xaa\x65\x2b\xa8\xe4\xc4\x33\x7c\x71\x29\x9c\x76\xdd\xb4\x37\x9a\xf0\x8a\x83\x83\xac\xd4\x08\x4d\x8d\xeb\xcf\x6b\x42\xbe\xa6\x9e\xe1\x23\x02\xe8\x92\xbc\xd8\x10\x2a\xb7\x79\x5d\x32\x8e\x8e\xf9\x8b\xf0\x42\x5f\x89\xd2\x54\xd6\x95\x7d\x5f\xd5\x4b\x46\xf6\xb1\x44\xa5\x97\x1a\x95\x04\x69\x2e\xee\xae\xd9\xb9\xe1\xa4\xf8\xbf\xd2\x67\x7a\x21\x9f\x92\x16\x64\x42\xa2\xcb\xc9\x3d\xe9\xb2\xeb\xb2\x2c\xa4\x2f\x5d\xfa\x8a\xc2\xc9\x76\xb7\x5e\x13\xd6\x7e\xdf\x95\x5d\xcf\x99\x2e\xe8\x9b\xfa\x2f\xdf\x49\xd5\x75\x14\xa0\xe8\xb7\x08\x24\x34\x74\xf5\x02\x9d\x39\x41\x20\x49\x3e\x75\x65\xde\x2e\x56\x9f\x13\xf9\x47\x5b\x39\xc0\xb4\x77\x68\x50\x99\x90\x94\x88\xa4\x06\xab\x20\x59\x34\x05\x7f\x9c\xd0\x1f\x15\x5d\xd5\x5d\x4f\x33\xee\x73\xa2\x01\x06\x93\x90\x0c\x40\x5f\xf5\xc0\x82\x46\x62\xfa\x76\x3c\x82\xe9\xab\xaa\xed\xfa\x27\x7d\x45\xc4\xfa\x61\x57\x27\xdc\x3f\x9a\x6d\x59\x31\x37\x26\xf4\xba\x21\x14\x21\xba\xa5\xfe\x9d\xdd\x5d\xfe\xcb\xbb\xa3\xf4\x82\x38\xd1\xb2\x2d\x29\x9c\x52\x19\xf4\x47\x79\xfe\x30\x4b\x28\x97\xd5\x74\x9a\xf7\xf9\x3c\xef\x4a\x8f\x56\x4e\x14\xea\x76\x69\xa0\x71\xe6\x6a\xe0\x60\x5d\x1f\xf5\x77\x6a\x86\x50\x19\x3a\xaf\x5c\x19\xef\x79\x72\x51\x3c\x33\x35\x64\xbe\x58\x97\x1c\x4f\x45\xa5\x6f\xdf\xbf\x3f\x3f\x7d\x99\x96\xf5\xb2\xaa\xcb\x74\x5f\xf5\xab\x74\xd7\x5f\xff\xb7\x6c\x59\xd6\x65\x4b\x3c\x6e\x51\xa5\x34\xa7\x5a\xa2\x84\x94\x08\x5b\x3a\x37\x4b\xba\x6e\x4d\x73\x1f\xe8\xbd\xbc\x7c\x97\x9e\x31\x8a\xb7\x79\xbf\x42\x43\xfa\x55\xd2\xfd\xbe\x66\x14\xb9\x0a\xaf\x56\x65\x0a\x2a\x03\x50\x73\x6d\xf8\x48\x0b\x6d\xe3\x2c\x29\xdb\x36\x23\xb6\xd4\xdf\x65\x9a\x59\xcb\x1b\x42\x4a\x11\x44\x3a\x75\xd3\xa7\xf3\x32\x45\x9e\x59\x92\x58\x83\x0d\xbb\xc7\xdb\xed\xba\x5a\xc8\x5c\x7f\x2d\x69\x1e\xd1\xbc\x82\x28\x96\x42\x38\x20\xca\xd2\x02\x74\x11\x7b\xe6\xf9\x90\x46\x0c\x04\xf9\x57\x25\x31\xc0\xd5\x6e\x29\x6c\x6f\xdd\xec\x8a\x1f\x40\xa9\xd6\x7a\x4f\xa8\xe9\x87\x86\x1a\x0c\xec\x38\x00\x5f\xc5\x31\x51\x1c\x2f\x5a\x6d\xb9\x69\x88\xaf\x38\x62\xaf\x88\xa0\xf6\x15\x25\x52\x4f\xbb\xfc\x96\xe6\x5b\xdf\xa4\xfd\xaa\xea\xd2\x82\x88\x6d\xc1\x05\xd3\xd4\xd8\xd1\x72\x21\x64\x41\x04\x2a\xa4\x61\x71\xf1\x18\x00\x6a\xb3\x23\x6a\x5a\x51\x61\xbc\x18\xf1\xca\x49\x45\x4e\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\x71\x65\xe6\x9b\xa7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xbe\xa6\x56\x75\x44\x15\x6f\xd2\xc5\xba\x21\x92\xfa\xf8\xe1\x5d\xc7\x04\xb3\xca\xb6\x4d\x8b\x65\x8e\x92\x2e\x28\xe8\xe2\x02\x44\x33\x44\xbd\xdb\xcc\xe9\x6b\xbf\xaa\x88\x03\x00\xed\x9c\x83\x57\x73\x8a\xa5\x2a\x76\x1d\x0d\xe1\x51\x4a\x24\x4c\x3d\x20\x94\x81\x00\xb8\x0f\x45\xd5\xe5\x73\x1a\x7b\x06\xbf\xa6\x65\x6b\xd7\x12\x59\xad\xfa\x7e\x6b\x35\xbf\xb9\xba\xba\x90\xaa\x5d\xec\x7d\x75\xe7\x01\x65\x60\x0c\xd6\xbc\xf0\xd6\x69\x53\xcf\x40\x24\xbb\x76\x3d\xa0\x1f\xea\xab\xa5\x1c\xc0\x0b\x37\xe1\x29\xff\x5c\x7a\xf4\x00\xcf\x1d\x49\x27\x7b\x50\x13\xe1\xb8\xc4\x02\x48\x44\xdd\x6c\xb9\xdc\x80\xaa\xcf\x35\xc2\x93\x32\x16\x4d\x97\x2e\x4b\x27\xa5\x42\xf6\x09\xd8\xff\x86\x3a\xac\x6c\xe4\xf2\x8c\xd0\x00\x5e\x82\xd8\xeb\xb6\xd9\x50\xec\x2b\xfa\xf3\x11\xbe\xf9\x67\x5c\x1e\x60\xf2\xa2\x20\xfe\xd6\x1d\xa5\x1f\x5e\x9d\xa4\xff\xf9\x0f\x3f\xff\x3c\x4b\xdf\xf6\x3c\x13\x99\x38\xff\xc6\x44\x45\x41\x59\xc3\x1d\x28\xb1\x8c\x9e\xe8\xee\x01\xcf\xac\x07\xe9\x3Line truncated
|
||||
|
||||
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
@@ -787,7 +787,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 39196, mode: os.FileMode(420), modTime: time.Unix(1440655385, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 39367, mode: os.FileMode(420), modTime: time.Unix(1440687482, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
+123
-122
@@ -5,8 +5,6 @@
|
||||
|
||||
package httplib
|
||||
|
||||
// NOTE: last sync 57e62e5 on Oct 29, 2014.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
@@ -27,7 +25,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var defaultSetting = BeegoHttpSettings{false, "beegoServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false}
|
||||
var defaultSetting = Settings{false, "GogsServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false}
|
||||
var defaultCookieJar http.CookieJar
|
||||
var settingMutex sync.Mutex
|
||||
|
||||
@@ -39,7 +37,7 @@ func createDefaultCookie() {
|
||||
}
|
||||
|
||||
// Overwrite default settings
|
||||
func SetDefaultSetting(setting BeegoHttpSettings) {
|
||||
func SetDefaultSetting(setting Settings) {
|
||||
settingMutex.Lock()
|
||||
defer settingMutex.Unlock()
|
||||
defaultSetting = setting
|
||||
@@ -51,8 +49,8 @@ func SetDefaultSetting(setting BeegoHttpSettings) {
|
||||
}
|
||||
}
|
||||
|
||||
// return *BeegoHttpRequest with specific method
|
||||
func newBeegoRequest(url, method string) *BeegoHttpRequest {
|
||||
// return *Request with specific method
|
||||
func newBeegoRequest(url, method string) *Request {
|
||||
var resp http.Response
|
||||
req := http.Request{
|
||||
Method: method,
|
||||
@@ -61,36 +59,35 @@ func newBeegoRequest(url, method string) *BeegoHttpRequest {
|
||||
ProtoMajor: 1,
|
||||
ProtoMinor: 1,
|
||||
}
|
||||
return &BeegoHttpRequest{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil}
|
||||
return &Request{url, &req, map[string]string{}, map[string]string{}, defaultSetting, &resp, nil}
|
||||
}
|
||||
|
||||
// Get returns *BeegoHttpRequest with GET method.
|
||||
func Get(url string) *BeegoHttpRequest {
|
||||
// Get returns *Request with GET method.
|
||||
func Get(url string) *Request {
|
||||
return newBeegoRequest(url, "GET")
|
||||
}
|
||||
|
||||
// Post returns *BeegoHttpRequest with POST method.
|
||||
func Post(url string) *BeegoHttpRequest {
|
||||
// Post returns *Request with POST method.
|
||||
func Post(url string) *Request {
|
||||
return newBeegoRequest(url, "POST")
|
||||
}
|
||||
|
||||
// Put returns *BeegoHttpRequest with PUT method.
|
||||
func Put(url string) *BeegoHttpRequest {
|
||||
// Put returns *Request with PUT method.
|
||||
func Put(url string) *Request {
|
||||
return newBeegoRequest(url, "PUT")
|
||||
}
|
||||
|
||||
// Delete returns *BeegoHttpRequest DELETE method.
|
||||
func Delete(url string) *BeegoHttpRequest {
|
||||
// Delete returns *Request DELETE method.
|
||||
func Delete(url string) *Request {
|
||||
return newBeegoRequest(url, "DELETE")
|
||||
}
|
||||
|
||||
// Head returns *BeegoHttpRequest with HEAD method.
|
||||
func Head(url string) *BeegoHttpRequest {
|
||||
// Head returns *Request with HEAD method.
|
||||
func Head(url string) *Request {
|
||||
return newBeegoRequest(url, "HEAD")
|
||||
}
|
||||
|
||||
// BeegoHttpSettings
|
||||
type BeegoHttpSettings struct {
|
||||
type Settings struct {
|
||||
ShowDebug bool
|
||||
UserAgent string
|
||||
ConnectTimeout time.Duration
|
||||
@@ -101,93 +98,97 @@ type BeegoHttpSettings struct {
|
||||
EnableCookie bool
|
||||
}
|
||||
|
||||
// BeegoHttpRequest provides more useful methods for requesting one url than http.Request.
|
||||
type BeegoHttpRequest struct {
|
||||
// HttpRequest provides more useful methods for requesting one url than http.Request.
|
||||
type Request struct {
|
||||
url string
|
||||
req *http.Request
|
||||
params map[string]string
|
||||
files map[string]string
|
||||
setting BeegoHttpSettings
|
||||
setting Settings
|
||||
resp *http.Response
|
||||
body []byte
|
||||
}
|
||||
|
||||
// Change request settings
|
||||
func (b *BeegoHttpRequest) Setting(setting BeegoHttpSettings) *BeegoHttpRequest {
|
||||
b.setting = setting
|
||||
return b
|
||||
func (r *Request) Setting(setting Settings) *Request {
|
||||
r.setting = setting
|
||||
return r
|
||||
}
|
||||
|
||||
// SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.
|
||||
func (b *BeegoHttpRequest) SetBasicAuth(username, password string) *BeegoHttpRequest {
|
||||
b.req.SetBasicAuth(username, password)
|
||||
return b
|
||||
func (r *Request) SetBasicAuth(username, password string) *Request {
|
||||
r.req.SetBasicAuth(username, password)
|
||||
return r
|
||||
}
|
||||
|
||||
// SetEnableCookie sets enable/disable cookiejar
|
||||
func (b *BeegoHttpRequest) SetEnableCookie(enable bool) *BeegoHttpRequest {
|
||||
b.setting.EnableCookie = enable
|
||||
return b
|
||||
func (r *Request) SetEnableCookie(enable bool) *Request {
|
||||
r.setting.EnableCookie = enable
|
||||
return r
|
||||
}
|
||||
|
||||
// SetUserAgent sets User-Agent header field
|
||||
func (b *BeegoHttpRequest) SetUserAgent(useragent string) *BeegoHttpRequest {
|
||||
b.setting.UserAgent = useragent
|
||||
return b
|
||||
func (r *Request) SetUserAgent(useragent string) *Request {
|
||||
r.setting.UserAgent = useragent
|
||||
return r
|
||||
}
|
||||
|
||||
// Debug sets show debug or not when executing request.
|
||||
func (b *BeegoHttpRequest) Debug(isdebug bool) *BeegoHttpRequest {
|
||||
b.setting.ShowDebug = isdebug
|
||||
return b
|
||||
func (r *Request) Debug(isdebug bool) *Request {
|
||||
r.setting.ShowDebug = isdebug
|
||||
return r
|
||||
}
|
||||
|
||||
// SetTimeout sets connect time out and read-write time out for BeegoRequest.
|
||||
func (b *BeegoHttpRequest) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *BeegoHttpRequest {
|
||||
b.setting.ConnectTimeout = connectTimeout
|
||||
b.setting.ReadWriteTimeout = readWriteTimeout
|
||||
return b
|
||||
func (r *Request) SetTimeout(connectTimeout, readWriteTimeout time.Duration) *Request {
|
||||
r.setting.ConnectTimeout = connectTimeout
|
||||
r.setting.ReadWriteTimeout = readWriteTimeout
|
||||
return r
|
||||
}
|
||||
|
||||
// SetTLSClientConfig sets tls connection configurations if visiting https url.
|
||||
func (b *BeegoHttpRequest) SetTLSClientConfig(config *tls.Config) *BeegoHttpRequest {
|
||||
b.setting.TlsClientConfig = config
|
||||
return b
|
||||
func (r *Request) SetTLSClientConfig(config *tls.Config) *Request {
|
||||
r.setting.TlsClientConfig = config
|
||||
return r
|
||||
}
|
||||
|
||||
// Header add header item string in request.
|
||||
func (b *BeegoHttpRequest) Header(key, value string) *BeegoHttpRequest {
|
||||
b.req.Header.Set(key, value)
|
||||
return b
|
||||
func (r *Request) Header(key, value string) *Request {
|
||||
r.req.Header.Set(key, value)
|
||||
return r
|
||||
}
|
||||
|
||||
func (r *Request) Headers() http.Header {
|
||||
return r.req.Header
|
||||
}
|
||||
|
||||
// Set the protocol version for incoming requests.
|
||||
// Client requests always use HTTP/1.1.
|
||||
func (b *BeegoHttpRequest) SetProtocolVersion(vers string) *BeegoHttpRequest {
|
||||
func (r *Request) SetProtocolVersion(vers string) *Request {
|
||||
if len(vers) == 0 {
|
||||
vers = "HTTP/1.1"
|
||||
}
|
||||
|
||||
major, minor, ok := http.ParseHTTPVersion(vers)
|
||||
if ok {
|
||||
b.req.Proto = vers
|
||||
b.req.ProtoMajor = major
|
||||
b.req.ProtoMinor = minor
|
||||
r.req.Proto = vers
|
||||
r.req.ProtoMajor = major
|
||||
r.req.ProtoMinor = minor
|
||||
}
|
||||
|
||||
return b
|
||||
return r
|
||||
}
|
||||
|
||||
// SetCookie add cookie into request.
|
||||
func (b *BeegoHttpRequest) SetCookie(cookie *http.Cookie) *BeegoHttpRequest {
|
||||
b.req.Header.Add("Cookie", cookie.String())
|
||||
return b
|
||||
func (r *Request) SetCookie(cookie *http.Cookie) *Request {
|
||||
r.req.Header.Add("Cookie", cookie.String())
|
||||
return r
|
||||
}
|
||||
|
||||
// Set transport to
|
||||
func (b *BeegoHttpRequest) SetTransport(transport http.RoundTripper) *BeegoHttpRequest {
|
||||
b.setting.Transport = transport
|
||||
return b
|
||||
func (r *Request) SetTransport(transport http.RoundTripper) *Request {
|
||||
r.setting.Transport = transport
|
||||
return r
|
||||
}
|
||||
|
||||
// Set http proxy
|
||||
@@ -197,47 +198,47 @@ func (b *BeegoHttpRequest) SetTransport(transport http.RoundTripper) *BeegoHttpR
|
||||
// u, _ := url.ParseRequestURI("http://127.0.0.1:8118")
|
||||
// return u, nil
|
||||
// }
|
||||
func (b *BeegoHttpRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *BeegoHttpRequest {
|
||||
b.setting.Proxy = proxy
|
||||
return b
|
||||
func (r *Request) SetProxy(proxy func(*http.Request) (*url.URL, error)) *Request {
|
||||
r.setting.Proxy = proxy
|
||||
return r
|
||||
}
|
||||
|
||||
// Param adds query param in to request.
|
||||
// params build query string as ?key1=value1&key2=value2...
|
||||
func (b *BeegoHttpRequest) Param(key, value string) *BeegoHttpRequest {
|
||||
b.params[key] = value
|
||||
return b
|
||||
func (r *Request) Param(key, value string) *Request {
|
||||
r.params[key] = value
|
||||
return r
|
||||
}
|
||||
|
||||
func (b *BeegoHttpRequest) PostFile(formname, filename string) *BeegoHttpRequest {
|
||||
b.files[formname] = filename
|
||||
return b
|
||||
func (r *Request) PostFile(formname, filename string) *Request {
|
||||
r.files[formname] = filename
|
||||
return r
|
||||
}
|
||||
|
||||
// Body adds request raw body.
|
||||
// it supports string and []byte.
|
||||
func (b *BeegoHttpRequest) Body(data interface{}) *BeegoHttpRequest {
|
||||
func (r *Request) Body(data interface{}) *Request {
|
||||
switch t := data.(type) {
|
||||
case string:
|
||||
bf := bytes.NewBufferString(t)
|
||||
b.req.Body = ioutil.NopCloser(bf)
|
||||
b.req.ContentLength = int64(len(t))
|
||||
r.req.Body = ioutil.NopCloser(bf)
|
||||
r.req.ContentLength = int64(len(t))
|
||||
case []byte:
|
||||
bf := bytes.NewBuffer(t)
|
||||
b.req.Body = ioutil.NopCloser(bf)
|
||||
b.req.ContentLength = int64(len(t))
|
||||
r.req.Body = ioutil.NopCloser(bf)
|
||||
r.req.ContentLength = int64(len(t))
|
||||
}
|
||||
return b
|
||||
return r
|
||||
}
|
||||
|
||||
func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
|
||||
if b.resp.StatusCode != 0 {
|
||||
return b.resp, nil
|
||||
func (r *Request) getResponse() (*http.Response, error) {
|
||||
if r.resp.StatusCode != 0 {
|
||||
return r.resp, nil
|
||||
}
|
||||
var paramBody string
|
||||
if len(b.params) > 0 {
|
||||
if len(r.params) > 0 {
|
||||
var buf bytes.Buffer
|
||||
for k, v := range b.params {
|
||||
for k, v := range r.params {
|
||||
buf.WriteString(url.QueryEscape(k))
|
||||
buf.WriteByte('=')
|
||||
buf.WriteString(url.QueryEscape(v))
|
||||
@@ -247,18 +248,18 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
|
||||
paramBody = paramBody[0 : len(paramBody)-1]
|
||||
}
|
||||
|
||||
if b.req.Method == "GET" && len(paramBody) > 0 {
|
||||
if strings.Index(b.url, "?") != -1 {
|
||||
b.url += "&" + paramBody
|
||||
if r.req.Method == "GET" && len(paramBody) > 0 {
|
||||
if strings.Index(r.url, "?") != -1 {
|
||||
r.url += "&" + paramBody
|
||||
} else {
|
||||
b.url = b.url + "?" + paramBody
|
||||
r.url = r.url + "?" + paramBody
|
||||
}
|
||||
} else if b.req.Method == "POST" && b.req.Body == nil {
|
||||
if len(b.files) > 0 {
|
||||
} else if r.req.Method == "POST" && r.req.Body == nil {
|
||||
if len(r.files) > 0 {
|
||||
pr, pw := io.Pipe()
|
||||
bodyWriter := multipart.NewWriter(pw)
|
||||
go func() {
|
||||
for formname, filename := range b.files {
|
||||
for formname, filename := range r.files {
|
||||
fileWriter, err := bodyWriter.CreateFormFile(formname, filename)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -274,53 +275,53 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
for k, v := range b.params {
|
||||
for k, v := range r.params {
|
||||
bodyWriter.WriteField(k, v)
|
||||
}
|
||||
bodyWriter.Close()
|
||||
pw.Close()
|
||||
}()
|
||||
b.Header("Content-Type", bodyWriter.FormDataContentType())
|
||||
b.req.Body = ioutil.NopCloser(pr)
|
||||
r.Header("Content-Type", bodyWriter.FormDataContentType())
|
||||
r.req.Body = ioutil.NopCloser(pr)
|
||||
} else if len(paramBody) > 0 {
|
||||
b.Header("Content-Type", "application/x-www-form-urlencoded")
|
||||
b.Body(paramBody)
|
||||
r.Header("Content-Type", "application/x-www-form-urlencoded")
|
||||
r.Body(paramBody)
|
||||
}
|
||||
}
|
||||
|
||||
url, err := url.Parse(b.url)
|
||||
url, err := url.Parse(r.url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
b.req.URL = url
|
||||
r.req.URL = url
|
||||
|
||||
trans := b.setting.Transport
|
||||
trans := r.setting.Transport
|
||||
|
||||
if trans == nil {
|
||||
// create default transport
|
||||
trans = &http.Transport{
|
||||
TLSClientConfig: b.setting.TlsClientConfig,
|
||||
Proxy: b.setting.Proxy,
|
||||
Dial: TimeoutDialer(b.setting.ConnectTimeout, b.setting.ReadWriteTimeout),
|
||||
TLSClientConfig: r.setting.TlsClientConfig,
|
||||
Proxy: r.setting.Proxy,
|
||||
Dial: TimeoutDialer(r.setting.ConnectTimeout, r.setting.ReadWriteTimeout),
|
||||
}
|
||||
} else {
|
||||
// if b.transport is *http.Transport then set the settings.
|
||||
// if r.transport is *http.Transport then set the settings.
|
||||
if t, ok := trans.(*http.Transport); ok {
|
||||
if t.TLSClientConfig == nil {
|
||||
t.TLSClientConfig = b.setting.TlsClientConfig
|
||||
t.TLSClientConfig = r.setting.TlsClientConfig
|
||||
}
|
||||
if t.Proxy == nil {
|
||||
t.Proxy = b.setting.Proxy
|
||||
t.Proxy = r.setting.Proxy
|
||||
}
|
||||
if t.Dial == nil {
|
||||
t.Dial = TimeoutDialer(b.setting.ConnectTimeout, b.setting.ReadWriteTimeout)
|
||||
t.Dial = TimeoutDialer(r.setting.ConnectTimeout, r.setting.ReadWriteTimeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var jar http.CookieJar
|
||||
if b.setting.EnableCookie {
|
||||
if r.setting.EnableCookie {
|
||||
if defaultCookieJar == nil {
|
||||
createDefaultCookie()
|
||||
}
|
||||
@@ -334,30 +335,30 @@ func (b *BeegoHttpRequest) getResponse() (*http.Response, error) {
|
||||
Jar: jar,
|
||||
}
|
||||
|
||||
if len(b.setting.UserAgent) > 0 && len(b.req.Header.Get("User-Agent")) == 0 {
|
||||
b.req.Header.Set("User-Agent", b.setting.UserAgent)
|
||||
if len(r.setting.UserAgent) > 0 && len(r.req.Header.Get("User-Agent")) == 0 {
|
||||
r.req.Header.Set("User-Agent", r.setting.UserAgent)
|
||||
}
|
||||
|
||||
if b.setting.ShowDebug {
|
||||
dump, err := httputil.DumpRequest(b.req, true)
|
||||
if r.setting.ShowDebug {
|
||||
dump, err := httputil.DumpRequest(r.req, true)
|
||||
if err != nil {
|
||||
println(err.Error())
|
||||
}
|
||||
println(string(dump))
|
||||
}
|
||||
|
||||
resp, err := client.Do(b.req)
|
||||
resp, err := client.Do(r.req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.resp = resp
|
||||
r.resp = resp
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// String returns the body string in response.
|
||||
// it calls Response inner.
|
||||
func (b *BeegoHttpRequest) String() (string, error) {
|
||||
data, err := b.Bytes()
|
||||
func (r *Request) String() (string, error) {
|
||||
data, err := r.Bytes()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
@@ -367,11 +368,11 @@ func (b *BeegoHttpRequest) String() (string, error) {
|
||||
|
||||
// Bytes returns the body []byte in response.
|
||||
// it calls Response inner.
|
||||
func (b *BeegoHttpRequest) Bytes() ([]byte, error) {
|
||||
if b.body != nil {
|
||||
return b.body, nil
|
||||
func (r *Request) Bytes() ([]byte, error) {
|
||||
if r.body != nil {
|
||||
return r.body, nil
|
||||
}
|
||||
resp, err := b.getResponse()
|
||||
resp, err := r.getResponse()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -383,20 +384,20 @@ func (b *BeegoHttpRequest) Bytes() ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.body = data
|
||||
r.body = data
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// ToFile saves the body data in response to one file.
|
||||
// it calls Response inner.
|
||||
func (b *BeegoHttpRequest) ToFile(filename string) error {
|
||||
func (r *Request) ToFile(filename string) error {
|
||||
f, err := os.Create(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
resp, err := b.getResponse()
|
||||
resp, err := r.getResponse()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -410,8 +411,8 @@ func (b *BeegoHttpRequest) ToFile(filename string) error {
|
||||
|
||||
// ToJson returns the map that marshals from the body bytes as json in response .
|
||||
// it calls Response inner.
|
||||
func (b *BeegoHttpRequest) ToJson(v interface{}) error {
|
||||
data, err := b.Bytes()
|
||||
func (r *Request) ToJson(v interface{}) error {
|
||||
data, err := r.Bytes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -421,8 +422,8 @@ func (b *BeegoHttpRequest) ToJson(v interface{}) error {
|
||||
|
||||
// ToXml returns the map that marshals from the body bytes as xml in response .
|
||||
// it calls Response inner.
|
||||
func (b *BeegoHttpRequest) ToXml(v interface{}) error {
|
||||
data, err := b.Bytes()
|
||||
func (r *Request) ToXml(v interface{}) error {
|
||||
data, err := r.Bytes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -431,8 +432,8 @@ func (b *BeegoHttpRequest) ToXml(v interface{}) error {
|
||||
}
|
||||
|
||||
// Response executes request client gets response mannually.
|
||||
func (b *BeegoHttpRequest) Response() (*http.Response, error) {
|
||||
return b.getResponse()
|
||||
func (r *Request) Response() (*http.Response, error) {
|
||||
return r.getResponse()
|
||||
}
|
||||
|
||||
// TimeoutDialer returns functions of connection dialer with timeout settings for http.Transport Dial field.
|
||||
|
||||
@@ -82,6 +82,7 @@ var (
|
||||
DeliverTimeout int
|
||||
SkipTLSVerify bool
|
||||
Types []string
|
||||
PagingNum int
|
||||
}
|
||||
|
||||
// Repository settings.
|
||||
@@ -601,6 +602,7 @@ func newWebhookService() {
|
||||
Webhook.DeliverTimeout = sec.Key("DELIVER_TIMEOUT").MustInt(5)
|
||||
Webhook.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool()
|
||||
Webhook.Types = []string{"gogs", "slack"}
|
||||
Webhook.PagingNum = sec.Key("PAGING_NUM").MustInt(10)
|
||||
}
|
||||
|
||||
func NewServices() {
|
||||
|
||||
Reference in new issue
Block a user