nokia / restful

A powerful RESTful framework for Go.
BSD 3-Clause "New" or "Revised" License
17 stars 14 forks source link

Monitor for clients #13

Closed Som-Som-CC closed 2 years ago

Som-Som-CC commented 3 years ago

The monitor (middleware) concept could be extended to clients.

c := restful.NewClient()
c.Monitor(pre0, post0).Monitor(nil, post1) // Similar function types as for the server.

// One could add data to ctx, if monitor needs that.
c.Get(ctx, ...)
// Internally Do() could just call pre and post, if not nil.
Som-Som-CC commented 2 years ago

Done in v1.5.0.