-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod.go
More file actions
42 lines (29 loc) · 1.52 KB
/
method.go
File metadata and controls
42 lines (29 loc) · 1.52 KB
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
package ginx
import (
"github.com/gin-gonic/gin"
"net/http"
)
type MethodGet struct{}
func (m *MethodGet) Method() string { return http.MethodGet }
func (m *MethodGet) Validate(ctx *gin.Context) error { return nil }
func (m *MethodGet) Path() string { return "" }
type MethodPost struct{}
func (m *MethodPost) Method() string { return http.MethodPost }
func (m *MethodPost) Validate(ctx *gin.Context) error { return nil }
func (m *MethodPost) Path() string { return "" }
type MethodPut struct{}
func (m *MethodPut) Method() string { return http.MethodPut }
func (m *MethodPut) Validate(ctx *gin.Context) error { return nil }
func (m *MethodPut) Path() string { return "" }
type MethodDelete struct{}
func (m *MethodDelete) Method() string { return http.MethodDelete }
func (m *MethodDelete) Validate(ctx *gin.Context) error { return nil }
func (m *MethodDelete) Path() string { return "" }
type MethodOptions struct{}
func (m *MethodOptions) Method() string { return http.MethodOptions }
func (m *MethodOptions) Validate(ctx *gin.Context) error { return nil }
func (m *MethodOptions) Path() string { return "" }
type MethodPatch struct{}
func (m *MethodPatch) Method() string { return http.MethodPatch }
func (m *MethodPatch) Validate(ctx *gin.Context) error { return nil }
func (m *MethodPatch) Path() string { return "" }