Skip to content

Commit

Permalink
Merge pull request #35 from gone-io/feature/1.x
Browse files Browse the repository at this point in the history
feat: goner/urllib add method`C()` for get *req.Client
  • Loading branch information
Degfy authored Sep 12, 2024
2 parents b457340 + a959e76 commit 60763c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions goner/urllib/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "github.com/imroc/req/v3"

type Client interface {
R() *req.Request
C() *req.Client
}

type Res[T any] struct {
Expand Down
6 changes: 6 additions & 0 deletions goner/urllib/req.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ func (r *r) AfterRevive() gone.AfterReviveError {

return nil
}

func (r *r) C() *req.Client {
c := req.C()
c.WrapRoundTripFunc(r.trip)
return c
}

0 comments on commit 60763c1

Please sign in to comment.