func Username(u string) metaOp {
	return func(c *Client) {
		c.Username = u
	}
}
Username is an option that can be provided to the func client.New.
package client
import (
	"bufio"
	"bytes"
	"compress/gzip"
	"crypto/tls"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"mime/multipart"
	"net/http"
	"net/url"
	"os"
	"path/filepath"
	"strings"
	"time"
	"github.com/asaskevich/govalidator"
	"github.com/intelsdi-x/snap/core"
	"github.com/intelsdi-x/snap/mgmt/rest/v1"
	"github.com/intelsdi-x/snap/mgmt/rest/v1/rbody"
)
var (
	CompressUpload = true
	ErrUnknown     = errors.New("Unknown error calling API")
	ErrNilResponse = errors.New("Nil response from JSON unmarshalling")
	ErrDirNotFile  = errors.New("Provided plugin path is a directory not file")
)
const (
	ContentTypeJSON contentType = iota
	ContentTypeBinary
)
type contentType int
var (
	contentTypes = [...]string{
		"application/json",
		"application/octet-stream",
	}
)
type Client struct {
	URL string
	Version string
	http *http.Client
	prefix string
	Username string
	Password string
}
func parseURL(url string) error {
	if !govalidator.IsURL(url) || !strings.HasPrefix(url, "http") {
		return fmt.Errorf("URL %s is not in the format of http(s)://<ip>:<port>", url)
	}
	return nil
}
type metaOp func(c *Client)
func Password(p string) metaOp {
	return func(c *Client) {
		c.Password = strings.TrimSpace(p)
	}
}