Browse Source

Update README.md

Volodymyr Tkach 2 years ago
parent
commit
e2c616def5
1 changed files with 13 additions and 0 deletions
  1. 13 0
      README.md

+ 13 - 0
README.md

@@ -120,3 +120,16 @@ func New(ctx context.Context, shutdown context.CancelFunc, db *database.DataBase
     return srv, nil
     return srv, nil
 }
 }
 ```
 ```
+
+## utils/http/helpers
+
+```go
+type CurlGetOpts struct {
+    ExpectStatusCode int
+    Headers          map[string][]string
+    Timeout          time.Duration
+}
+
+func CurlDownload(ctx context.Context, url string, opts *CurlGetOpts, fileName string, filePath ...string) error
+func CurlGet(ctx context.Context, url string, opts *CurlGetOpts) ([]byte, error)
+```