boosty / request /options.go
hocki1's picture
first_commit
2c8c8ba
raw
history blame contribute delete
447 Bytes
package request
import (
"net/http"
"gohome.4gophers.ru/getapp/boosty/auth"
)
type Option func(b *Request) error
func WithClient(client *http.Client) Option {
return func(r *Request) error {
r.client = client
return nil
}
}
func WithAuth(auth *auth.Auth) Option {
return func(r *Request) error {
r.auth = auth
return nil
}
}
func WithUrl(url string) Option {
return func(r *Request) error {
r.url = url
return nil
}
}