for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
package client
import (
"net/http"
"strings"
)
// Option is options for constructing a client
type Option interface {
apply(config *clientConfig)
}
type clientOptionFunc func(config *clientConfig)
func (fn clientOptionFunc) apply(config *clientConfig) {
fn(config)
// WithHTTPClient sets the underlying HTTP client used for API requests.
// By default, http.DefaultClient is used.
func WithHTTPClient(httpClient *http.Client) Option {
return clientOptionFunc(func(config *clientConfig) {
if httpClient != nil {
config.httpClient = httpClient
})
// WithBaseURL set's the base url for the flutterwave API
func WithBaseURL(baseURL string) Option {
if baseURL != "" {
config.baseURL = strings.TrimRight(baseURL, "/")
// WithDelay sets the delay in milliseconds before a response is gotten.
// The delay must be > 0 for it to be used.
func WithDelay(delay int) Option {
if delay > 0 {
config.delay = delay