@@ -66,6 +66,9 @@ <h2 id="pkg-index">Index</h2>
66
66
< dd > < a href ="#Get "> func Get(route string, handler interface{})</ a > </ dd >
67
67
68
68
69
+ < dd > < a href ="#Match "> func Match(method string, route string, handler interface{})</ a > </ dd >
70
+
71
+
69
72
< dd > < a href ="#Post "> func Post(route string, handler interface{})</ a > </ dd >
70
73
71
74
@@ -147,6 +150,9 @@ <h2 id="pkg-index">Index</h2>
147
150
< dd > < a href ="#Server.Get "> func (s *Server) Get(route string, handler interface{})</ a > </ dd >
148
151
149
152
153
+ < dd > < a href ="#Server.Match "> func (s *Server) Match(method string, route string, handler interface{})</ a > </ dd >
154
+
155
+
150
156
< dd > < a href ="#Server.Post "> func (s *Server) Post(route string, handler interface{})</ a > </ dd >
151
157
152
158
@@ -214,7 +220,7 @@ <h2 id="pkg-variables">Variables</h2>
214
220
215
221
216
222
217
- < h2 id ="Close "> func < a href ="/target/web.go?s=14156:14168#L496 "> Close</ a > </ h2 >
223
+ < h2 id ="Close "> func < a href ="/target/web.go?s=14155:14167#L495 "> Close</ a > </ h2 >
218
224
< pre > func Close()</ pre >
219
225
< p >
220
226
Close stops the main server.
@@ -224,7 +230,7 @@ <h2 id="Close">func <a href="/target/web.go?s=14156:14168#L496">Close</a></h2>
224
230
225
231
226
232
227
- < h2 id ="Delete "> func < a href ="/target/web.go?s=15415:15461#L536 "> Delete</ a > </ h2 >
233
+ < h2 id ="Delete "> func < a href ="/target/web.go?s=15598:15644#L540 "> Delete</ a > </ h2 >
228
234
< pre > func Delete(route string, handler interface{})</ pre >
229
235
< p >
230
236
Delete adds a handler for the 'DELETE' http method in the main server.
@@ -234,7 +240,7 @@ <h2 id="Delete">func <a href="/target/web.go?s=15415:15461#L536">Delete</a></h2>
234
240
235
241
236
242
237
- < h2 id ="Get "> func < a href ="/target/web.go?s=14925:14968#L521 "> Get</ a > </ h2 >
243
+ < h2 id ="Get "> func < a href ="/target/web.go?s=15108:15151#L525 "> Get</ a > </ h2 >
238
244
< pre > func Get(route string, handler interface{})</ pre >
239
245
< p >
240
246
Get adds a handler for the 'GET' http method in the main server.
@@ -244,7 +250,17 @@ <h2 id="Get">func <a href="/target/web.go?s=14925:14968#L521">Get</a></h2>
244
250
245
251
246
252
247
- < h2 id ="Post "> func < a href ="/target/web.go?s=15079:15123#L526 "> Post</ a > </ h2 >
253
+ < h2 id ="Match "> func < a href ="/target/web.go?s=15773:15833#L545 "> Match</ a > </ h2 >
254
+ < pre > func Match(method string, route string, handler interface{})</ pre >
255
+ < p >
256
+ Match adds a handler for an arbitrary http method in the main server.
257
+ </ p >
258
+
259
+
260
+
261
+
262
+
263
+ < h2 id ="Post "> func < a href ="/target/web.go?s=15262:15306#L530 "> Post</ a > </ h2 >
248
264
< pre > func Post(route string, handler interface{})</ pre >
249
265
< p >
250
266
Post adds a handler for the 'POST' http method in the main server.
@@ -254,7 +270,7 @@ <h2 id="Post">func <a href="/target/web.go?s=15079:15123#L526">Post</a></h2>
254
270
255
271
256
272
257
- < h2 id ="Put "> func < a href ="/target/web.go?s=15245:15288#L531 "> Put</ a > </ h2 >
273
+ < h2 id ="Put "> func < a href ="/target/web.go?s=15428:15471#L535 "> Put</ a > </ h2 >
258
274
< pre > func Put(route string, handler interface{})</ pre >
259
275
< p >
260
276
Put adds a handler for the 'PUT' http method in the main server.
@@ -264,7 +280,7 @@ <h2 id="Put">func <a href="/target/web.go?s=15245:15288#L531">Put</a></h2>
264
280
265
281
266
282
267
- < h2 id ="Run "> func < a href ="/target/web.go?s=12693:12714#L440 "> Run</ a > </ h2 >
283
+ < h2 id ="Run "> func < a href ="/target/web.go?s=12692:12713#L439 "> Run</ a > </ h2 >
268
284
< pre > func Run(addr string)</ pre >
269
285
< p >
270
286
Run starts the web application and serves HTTP requests for the main server.
@@ -274,7 +290,7 @@ <h2 id="Run">func <a href="/target/web.go?s=12693:12714#L440">Run</a></h2>
274
290
275
291
276
292
277
- < h2 id ="RunFcgi "> func < a href ="/target/web.go?s=13963:13988#L484 "> RunFcgi</ a > </ h2 >
293
+ < h2 id ="RunFcgi "> func < a href ="/target/web.go?s=13962:13987#L483 "> RunFcgi</ a > </ h2 >
278
294
< pre > func RunFcgi(addr string)</ pre >
279
295
< p >
280
296
RunFcgi starts the web application and serves FastCGI requests for the main server.
@@ -284,7 +300,7 @@ <h2 id="RunFcgi">func <a href="/target/web.go?s=13963:13988#L484">RunFcgi</a></h
284
300
285
301
286
302
287
- < h2 id ="RunScgi "> func < a href ="/target/web.go?s=13596:13621#L472 "> RunScgi</ a > </ h2 >
303
+ < h2 id ="RunScgi "> func < a href ="/target/web.go?s=13595:13620#L471 "> RunScgi</ a > </ h2 >
288
304
< pre > func RunScgi(addr string)</ pre >
289
305
< p >
290
306
RunScgi starts the web application and serves SCGI requests for the main server.
@@ -294,7 +310,7 @@ <h2 id="RunScgi">func <a href="/target/web.go?s=13596:13621#L472">RunScgi</a></h
294
310
295
311
296
312
297
- < h2 id ="RunTLS "> func < a href ="/target/web.go?s=13209:13253#L460 "> RunTLS</ a > </ h2 >
313
+ < h2 id ="RunTLS "> func < a href ="/target/web.go?s=13208:13252#L459 "> RunTLS</ a > </ h2 >
298
314
< pre > func RunTLS(addr string, config *tls.Config)</ pre >
299
315
< p >
300
316
RunTLS starts the web application and serves HTTPS requests for the main server.
@@ -304,7 +320,7 @@ <h2 id="RunTLS">func <a href="/target/web.go?s=13209:13253#L460">RunTLS</a></h2>
304
320
305
321
306
322
307
- < h2 id ="SetLogger "> func < a href ="/target/web.go?s=15683:15717#L546 "> SetLogger</ a > </ h2 >
323
+ < h2 id ="SetLogger "> func < a href ="/target/web.go?s=16053:16087#L555 "> SetLogger</ a > </ h2 >
308
324
< pre > func SetLogger(logger *log.Logger)</ pre >
309
325
< p >
310
326
SetLogger sets the logger for the main server.
@@ -314,7 +330,7 @@ <h2 id="SetLogger">func <a href="/target/web.go?s=15683:15717#L546">SetLogger</a
314
330
315
331
316
332
317
- < h2 id ="Urlencode "> func < a href ="/target/web.go?s=16559:16604#L589 "> Urlencode</ a > </ h2 >
333
+ < h2 id ="Urlencode "> func < a href ="/target/web.go?s=16929:16974#L598 "> Urlencode</ a > </ h2 >
318
334
< pre > func Urlencode(data map[string]string) string</ pre >
319
335
< p >
320
336
Urlencode is a helper method that converts a map into URL-encoded form data.
@@ -326,7 +342,7 @@ <h2 id="Urlencode">func <a href="/target/web.go?s=16559:16604#L589">Urlencode</a
326
342
327
343
328
344
329
- < h2 id ="Context "> type < a href ="/target/web.go?s=855:973#L31 "> Context</ a > </ h2 >
345
+ < h2 id ="Context "> type < a href ="/target/web.go?s=854:972#L30 "> Context</ a > </ h2 >
330
346
< pre > type Context struct {
331
347
Request *http.Request
332
348
Params map[string]string
@@ -351,7 +367,7 @@ <h2 id="Context">type <a href="/target/web.go?s=855:973#L31">Context</a></h2>
351
367
352
368
353
369
354
- < h3 id ="Context.Abort "> func (*Context) < a href ="/target/web.go?s=1361:1411#L47 "> Abort</ a > </ h3 >
370
+ < h3 id ="Context.Abort "> func (*Context) < a href ="/target/web.go?s=1360:1410#L46 "> Abort</ a > </ h3 >
355
371
< pre > func (ctx *Context) Abort(status int, body string)</ pre >
356
372
< p >
357
373
Abort is a helper method that sends an HTTP header and an optional
@@ -364,7 +380,7 @@ <h3 id="Context.Abort">func (*Context) <a href="/target/web.go?s=1361:1411#L47">
364
380
365
381
366
382
367
- < h3 id ="Context.ContentType "> func (*Context) < a href ="/target/web.go?s=2224:2267#L72 "> ContentType</ a > </ h3 >
383
+ < h3 id ="Context.ContentType "> func (*Context) < a href ="/target/web.go?s=2223:2266#L71 "> ContentType</ a > </ h3 >
368
384
< pre > func (ctx *Context) ContentType(ext string)</ pre >
369
385
< p >
370
386
Sets the content type by extension, as defined in the mime package.
@@ -375,14 +391,14 @@ <h3 id="Context.ContentType">func (*Context) <a href="/target/web.go?s=2224:2267
375
391
376
392
377
393
378
- < h3 id ="Context.GetSecureCookie "> func (*Context) < a href ="/target/web.go?s=4255:4318#L134 "> GetSecureCookie</ a > </ h3 >
394
+ < h3 id ="Context.GetSecureCookie "> func (*Context) < a href ="/target/web.go?s=4254:4317#L133 "> GetSecureCookie</ a > </ h3 >
379
395
< pre > func (ctx *Context) GetSecureCookie(name string) (string, bool)</ pre >
380
396
381
397
382
398
383
399
384
400
385
- < h3 id ="Context.NotFound "> func (*Context) < a href ="/target/web.go?s=1933:1977#L65 "> NotFound</ a > </ h3 >
401
+ < h3 id ="Context.NotFound "> func (*Context) < a href ="/target/web.go?s=1932:1976#L64 "> NotFound</ a > </ h3 >
386
402
< pre > func (ctx *Context) NotFound(message string)</ pre >
387
403
< p >
388
404
NotFound writes a 404 HTTP response
@@ -392,7 +408,7 @@ <h3 id="Context.NotFound">func (*Context) <a href="/target/web.go?s=1933:1977#L6
392
408
393
409
394
410
395
- < h3 id ="Context.NotModified "> func (*Context) < a href ="/target/web.go?s=1815:1848#L60 "> NotModified</ a > </ h3 >
411
+ < h3 id ="Context.NotModified "> func (*Context) < a href ="/target/web.go?s=1814:1847#L59 "> NotModified</ a > </ h3 >
396
412
< pre > func (ctx *Context) NotModified()</ pre >
397
413
< p >
398
414
Notmodified writes a 304 HTTP response
@@ -402,7 +418,7 @@ <h3 id="Context.NotModified">func (*Context) <a href="/target/web.go?s=1815:1848
402
418
403
419
404
420
405
- < h3 id ="Context.Redirect "> func (*Context) < a href ="/target/web.go?s=1553:1606#L53 "> Redirect</ a > </ h3 >
421
+ < h3 id ="Context.Redirect "> func (*Context) < a href ="/target/web.go?s=1552:1605#L52 "> Redirect</ a > </ h3 >
406
422
< pre > func (ctx *Context) Redirect(status int, url_ string)</ pre >
407
423
< p >
408
424
Redirect is a helper method for 3xx redirects.
@@ -412,7 +428,7 @@ <h3 id="Context.Redirect">func (*Context) <a href="/target/web.go?s=1553:1606#L5
412
428
413
429
414
430
415
- < h3 id ="Context.SetCookie "> func (*Context) < a href ="/target/web.go?s=2901:2968#L94 "> SetCookie</ a > </ h3 >
431
+ < h3 id ="Context.SetCookie "> func (*Context) < a href ="/target/web.go?s=2900:2967#L93 "> SetCookie</ a > </ h3 >
416
432
< pre > func (ctx *Context) SetCookie(name string, value string, age int64)</ pre >
417
433
< p >
418
434
SetCookie sets a cookie header. Duration is specified in seconds. If the duration
@@ -423,7 +439,7 @@ <h3 id="Context.SetCookie">func (*Context) <a href="/target/web.go?s=2901:2968#L
423
439
424
440
425
441
426
- < h3 id ="Context.SetHeader "> func (*Context) < a href ="/target/web.go?s=2602:2668#L84 "> SetHeader</ a > </ h3 >
442
+ < h3 id ="Context.SetHeader "> func (*Context) < a href ="/target/web.go?s=2601:2667#L83 "> SetHeader</ a > </ h3 >
427
443
< pre > func (ctx *Context) SetHeader(hdr string, val string, unique bool)</ pre >
428
444
< p >
429
445
SetHeader sets a response header. If `unique` is true, the current value
@@ -434,14 +450,14 @@ <h3 id="Context.SetHeader">func (*Context) <a href="/target/web.go?s=2602:2668#L
434
450
435
451
436
452
437
- < h3 id ="Context.SetSecureCookie "> func (*Context) < a href ="/target/web.go?s=3528:3599#L116 "> SetSecureCookie</ a > </ h3 >
453
+ < h3 id ="Context.SetSecureCookie "> func (*Context) < a href ="/target/web.go?s=3527:3598#L115 "> SetSecureCookie</ a > </ h3 >
438
454
< pre > func (ctx *Context) SetSecureCookie(name string, val string, age int64)</ pre >
439
455
440
456
441
457
442
458
443
459
444
- < h3 id ="Context.WriteString "> func (*Context) < a href ="/target/web.go?s=1035:1082#L39 "> WriteString</ a > </ h3 >
460
+ < h3 id ="Context.WriteString "> func (*Context) < a href ="/target/web.go?s=1034:1081#L38 "> WriteString</ a > </ h3 >
445
461
< pre > func (ctx *Context) WriteString(content string)</ pre >
446
462
< p >
447
463
WriteString writes string data into the response object.
@@ -453,7 +469,7 @@ <h3 id="Context.WriteString">func (*Context) <a href="/target/web.go?s=1035:1082
453
469
454
470
455
471
456
- < h2 id ="ResponseWriter "> type < a href ="/target/web.go?s=441:581#L20 "> ResponseWriter</ a > </ h2 >
472
+ < h2 id ="ResponseWriter "> type < a href ="/target/web.go?s=440:580#L19 "> ResponseWriter</ a > </ h2 >
457
473
< pre > type ResponseWriter interface {
458
474
Header() http.Header
459
475
WriteHeader(status int)
@@ -474,7 +490,7 @@ <h2 id="ResponseWriter">type <a href="/target/web.go?s=441:581#L20">ResponseWrit
474
490
475
491
476
492
477
- < h2 id ="Server "> type < a href ="/target/web.go?s=11378:11566#L390 "> Server</ a > </ h2 >
493
+ < h2 id ="Server "> type < a href ="/target/web.go?s=11377:11565#L389 "> Server</ a > </ h2 >
478
494
< pre > type Server struct {
479
495
Config *ServerConfig
480
496
@@ -495,15 +511,15 @@ <h2 id="Server">type <a href="/target/web.go?s=11378:11566#L390">Server</a></h2>
495
511
496
512
497
513
498
- < h3 id ="NewServer "> func < a href ="/target/web.go?s=11568:11592#L399 "> NewServer</ a > </ h3 >
514
+ < h3 id ="NewServer "> func < a href ="/target/web.go?s=11567:11591#L398 "> NewServer</ a > </ h3 >
499
515
< pre > func NewServer() *Server</ pre >
500
516
501
517
502
518
503
519
504
520
505
521
506
- < h3 id ="Server.Close "> func (*Server) < a href ="/target/web.go?s=14048:14072#L489 "> Close</ a > </ h3 >
522
+ < h3 id ="Server.Close "> func (*Server) < a href ="/target/web.go?s=14047:14071#L488 "> Close</ a > </ h3 >
507
523
< pre > func (s *Server) Close()</ pre >
508
524
< p >
509
525
Close stops server s.
@@ -513,7 +529,7 @@ <h3 id="Server.Close">func (*Server) <a href="/target/web.go?s=14048:14072#L489"
513
529
514
530
515
531
516
- < h3 id ="Server.Delete "> func (*Server) < a href ="/target/web.go?s=14752:14810#L516 "> Delete</ a > </ h3 >
532
+ < h3 id ="Server.Delete "> func (*Server) < a href ="/target/web.go?s=14751:14809#L515 "> Delete</ a > </ h3 >
517
533
< pre > func (s *Server) Delete(route string, handler interface{})</ pre >
518
534
< p >
519
535
Delete adds a handler for the 'DELETE' http method for server s.
@@ -523,7 +539,7 @@ <h3 id="Server.Delete">func (*Server) <a href="/target/web.go?s=14752:14810#L516
523
539
524
540
525
541
526
- < h3 id ="Server.Get "> func (*Server) < a href ="/target/web.go?s=14259:14314#L501 "> Get</ a > </ h3 >
542
+ < h3 id ="Server.Get "> func (*Server) < a href ="/target/web.go?s=14258:14313#L500 "> Get</ a > </ h3 >
527
543
< pre > func (s *Server) Get(route string, handler interface{})</ pre >
528
544
< p >
529
545
Get adds a handler for the 'GET' http method for server s.
@@ -533,7 +549,17 @@ <h3 id="Server.Get">func (*Server) <a href="/target/web.go?s=14259:14314#L501">G
533
549
534
550
535
551
536
- < h3 id ="Server.Post "> func (*Server) < a href ="/target/web.go?s=14422:14478#L506 "> Post</ a > </ h3 >
552
+ < h3 id ="Server.Match "> func (*Server) < a href ="/target/web.go?s=14923:14995#L520 "> Match</ a > </ h3 >
553
+ < pre > func (s *Server) Match(method string, route string, handler interface{})</ pre >
554
+ < p >
555
+ Match adds a handler for an arbitrary http method for server s.
556
+ </ p >
557
+
558
+
559
+
560
+
561
+
562
+ < h3 id ="Server.Post "> func (*Server) < a href ="/target/web.go?s=14421:14477#L505 "> Post</ a > </ h3 >
537
563
< pre > func (s *Server) Post(route string, handler interface{})</ pre >
538
564
< p >
539
565
Post adds a handler for the 'POST' http method for server s.
@@ -543,7 +569,7 @@ <h3 id="Server.Post">func (*Server) <a href="/target/web.go?s=14422:14478#L506">
543
569
544
570
545
571
546
- < h3 id ="Server.Put "> func (*Server) < a href ="/target/web.go?s=14585:14640#L511 "> Put</ a > </ h3 >
572
+ < h3 id ="Server.Put "> func (*Server) < a href ="/target/web.go?s=14584:14639#L510 "> Put</ a > </ h3 >
547
573
< pre > func (s *Server) Put(route string, handler interface{})</ pre >
548
574
< p >
549
575
Put adds a handler for the 'PUT' http method for server s.
@@ -553,7 +579,7 @@ <h3 id="Server.Put">func (*Server) <a href="/target/web.go?s=14585:14640#L511">P
553
579
554
580
555
581
556
- < h3 id ="Server.Run "> func (*Server) < a href ="/target/web.go?s=12012:12045#L418 "> Run</ a > </ h3 >
582
+ < h3 id ="Server.Run "> func (*Server) < a href ="/target/web.go?s=12011:12044#L417 "> Run</ a > </ h3 >
557
583
< pre > func (s *Server) Run(addr string)</ pre >
558
584
< p >
559
585
Run starts the web application and serves HTTP requests for s
@@ -563,7 +589,7 @@ <h3 id="Server.Run">func (*Server) <a href="/target/web.go?s=12012:12045#L418">R
563
589
564
590
565
591
566
- < h3 id ="Server.RunFcgi "> func (*Server) < a href ="/target/web.go?s=13729:13766#L477 "> RunFcgi</ a > </ h3 >
592
+ < h3 id ="Server.RunFcgi "> func (*Server) < a href ="/target/web.go?s=13728:13765#L476 "> RunFcgi</ a > </ h3 >
567
593
< pre > func (s *Server) RunFcgi(addr string)</ pre >
568
594
< p >
569
595
RunFcgi starts the web application and serves FastCGI requests for s.
@@ -573,7 +599,7 @@ <h3 id="Server.RunFcgi">func (*Server) <a href="/target/web.go?s=13729:13766#L47
573
599
574
600
575
601
576
- < h3 id ="Server.RunScgi "> func (*Server) < a href ="/target/web.go?s=13365:13402#L465 "> RunScgi</ a > </ h3 >
602
+ < h3 id ="Server.RunScgi "> func (*Server) < a href ="/target/web.go?s=13364:13401#L464 "> RunScgi</ a > </ h3 >
577
603
< pre > func (s *Server) RunScgi(addr string)</ pre >
578
604
< p >
579
605
RunScgi starts the web application and serves SCGI requests for s.
@@ -583,7 +609,7 @@ <h3 id="Server.RunScgi">func (*Server) <a href="/target/web.go?s=13365:13402#L46
583
609
584
610
585
611
586
- < h3 id ="Server.RunTLS "> func (*Server) < a href ="/target/web.go?s=12815:12877#L445 "> RunTLS</ a > </ h3 >
612
+ < h3 id ="Server.RunTLS "> func (*Server) < a href ="/target/web.go?s=12814:12876#L444 "> RunTLS</ a > </ h3 >
587
613
< pre > func (s *Server) RunTLS(addr string, config *tls.Config) error</ pre >
588
614
< p >
589
615
RunTLS starts the web application and serves HTTPS requests for s.
@@ -593,14 +619,14 @@ <h3 id="Server.RunTLS">func (*Server) <a href="/target/web.go?s=12815:12877#L445
593
619
594
620
595
621
596
- < h3 id ="Server.ServeHTTP "> func (*Server) < a href ="/target/web.go?s=6530:6598#L228 "> ServeHTTP</ a > </ h3 >
622
+ < h3 id ="Server.ServeHTTP "> func (*Server) < a href ="/target/web.go?s=6529:6597#L227 "> ServeHTTP</ a > </ h3 >
597
623
< pre > func (s *Server) ServeHTTP(c http.ResponseWriter, req *http.Request)</ pre >
598
624
599
625
600
626
601
627
602
628
603
- < h3 id ="Server.SetLogger "> func (*Server) < a href ="/target/web.go?s=15559:15605#L541 "> SetLogger</ a > </ h3 >
629
+ < h3 id ="Server.SetLogger "> func (*Server) < a href ="/target/web.go?s=15929:15975#L550 "> SetLogger</ a > </ h3 >
604
630
< pre > func (s *Server) SetLogger(logger *log.Logger)</ pre >
605
631
< p >
606
632
SetLogger sets the logger for server s
@@ -612,7 +638,7 @@ <h3 id="Server.SetLogger">func (*Server) <a href="/target/web.go?s=15559:15605#L
612
638
613
639
614
640
615
- < h2 id ="ServerConfig "> type < a href ="/target/web.go?s=11194:11337#L381 "> ServerConfig</ a > </ h2 >
641
+ < h2 id ="ServerConfig "> type < a href ="/target/web.go?s=11193:11336#L380 "> ServerConfig</ a > </ h2 >
616
642
< pre > type ServerConfig struct {
617
643
StaticDir string
618
644
Addr string
0 commit comments