func (n *namespaceClient) Create(req *admin.NamespaceAddRequest) error {
	url := n.url + namespaceBaseURL
	err := n.client.DoHTTPJSONPBRequest(http.MethodPost, url, req, nil)
	if err != nil {
		return err
	}
	n.logger.Info("successfully created namespace", zap.String("namespace", req.Name))
	return nil
}
Create will create a namespace
package namespace
import (
	"errors"
	"fmt"
	"net/http"
	"net/url"
	"github.com/m3db/m3db-operator/pkg/m3admin"
	"github.com/m3db/m3/src/query/generated/proto/admin"
	"go.uber.org/zap"
)
const (
	namespaceBaseURL   = "/api/v1/services/m3db/namespace"
	namespaceDeleteFmt = namespaceBaseURL + "/%s"
	namespaceReadyURL  = namespaceBaseURL + "/ready"
)
type namespaceClient struct {
	client m3admin.Client
	logger *zap.Logger
	url    string
}
type Option interface {
	execute(*namespaceClient) error
}
type optionFn func(n *namespaceClient) error
func (fn optionFn) execute(n *namespaceClient) error {
	return fn(n)
}
func WithURL(u string) Option {
	return optionFn(func(n *namespaceClient) error {
		if _, err := url.ParseRequestURI(u); err != nil {
			return err
		}
		n.url = u
		return nil
	})
}
func WithLogger(logger *zap.Logger) Option {
	return optionFn(func(n *namespaceClient) error {
		n.logger = logger
		return nil
	})
}
func WithClient(cl m3admin.Client) Option {
	return optionFn(func(n *namespaceClient) error {
		n.client = cl
		return nil
	})
}
func NewClient(opts ...Option) (Client, error) {
	logger := zap.NewNop()
	ns := &namespaceClient{
		client: m3admin.NewClient(),
		logger: logger,
	}
	for _, o := range opts {
		if err := o.execute(ns); err != nil {
			return nil, err
		}
	}
	return ns, nil
}