From 912a82b7da4dd3758726d0ae9a7bc9609c6f28f1 Mon Sep 17 00:00:00 2001 From: GrindStone Date: Wed, 24 Nov 2021 04:07:04 +0700 Subject: [PATCH] feat: export method type --- .gitignore | 3 +++ method.go | 62 +++++++++++++++++++++++++++--------------------------- request.go | 2 +- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index 847c4b3..d5ce55e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ .vscode coverage.txt + +# For GoLand user +.idea diff --git a/method.go b/method.go index cbc2393..ebded68 100644 --- a/method.go +++ b/method.go @@ -1,36 +1,36 @@ package postman -type method string +type Method string const ( - // Get HTTP method. - Get method = "GET" - // Put HTTP method. - Put method = "PUT" - // Post HTTP method. - Post method = "POST" - // Patch HTTP method. - Patch method = "PATCH" - // Delete HTTP method. - Delete method = "DELETE" - // Copy HTTP method. - Copy method = "COPY" - // Head HTTP method. - Head method = "HEAD" - // Options HTTP method. - Options method = "OPTIONS" - // Link HTTP method. - Link method = "LINK" - // Unlink HTTP method. - Unlink method = "UNLINK" - // Purge HTTP method. - Purge method = "PURGE" - // Lock HTTP method. - Lock method = "LOCK" - // Unlock HTTP method. - Unlock method = "UNLOCK" - // Propfind HTTP method. - Propfind method = "PROPFIND" - // View HTTP method. - View method = "VIEW" + // Get HTTP Method. + Get Method = "GET" + // Put HTTP Method. + Put Method = "PUT" + // Post HTTP Method. + Post Method = "POST" + // Patch HTTP Method. + Patch Method = "PATCH" + // Delete HTTP Method. + Delete Method = "DELETE" + // Copy HTTP Method. + Copy Method = "COPY" + // Head HTTP Method. + Head Method = "HEAD" + // Options HTTP Method. + Options Method = "OPTIONS" + // Link HTTP Method. + Link Method = "LINK" + // Unlink HTTP Method. + Unlink Method = "UNLINK" + // Purge HTTP Method. + Purge Method = "PURGE" + // Lock HTTP Method. + Lock Method = "LOCK" + // Unlock HTTP Method. + Unlock Method = "UNLOCK" + // Propfind HTTP Method. + Propfind Method = "PROPFIND" + // View HTTP Method. + View Method = "VIEW" ) diff --git a/request.go b/request.go index b6b1251..c5ab444 100644 --- a/request.go +++ b/request.go @@ -12,7 +12,7 @@ type Request struct { Auth *Auth `json:"auth,omitempty"` Proxy interface{} `json:"proxy,omitempty"` Certificate interface{} `json:"certificate,omitempty"` - Method method `json:"method"` + Method Method `json:"method"` Description interface{} `json:"description,omitempty"` Header []*Header `json:"header,omitempty"` Body *Body `json:"body,omitempty"`