func Login(host, username, password, apiVersion, metadataServiceProxy, dataServiceProxy string, verbose bool) (api *RestApi, err error) {
	if apiVersion == "" {
		apiVersion = "2"
	}
	loginStart := time.Now()
	if verbose {
		fmt.Println(fmt.Sprintf("Logging in to Skuid Platform as user: %v\n%v", username, host))
		fmt.Println("API Version: " + apiVersion)
	}
	conn := RestConnection{
		Host:       host,
		Username:   username,
		Password:   password,
		APIVersion: apiVersion,
	}
	if metadataServiceProxy != "" {
		proxyURL, err := url.Parse(metadataServiceProxy)
		if err != nil {
			return nil, err
		}
		conn.MetadataServiceProxy = proxyURL
	}
	if dataServiceProxy != "" {
		proxyURL, err := url.Parse(dataServiceProxy)
		if err != nil {
			return nil, err
		}
		conn.DataServiceProxy = proxyURL
	}
	err = conn.Refresh()
	if err != nil {
		return nil, err
	}
	err = conn.GetJWT()
	if err != nil {
		return nil, err
	}
	api = &RestApi{
		Connection: &conn,
	}
	if verbose {
		fmt.Println(text.SuccessWithTime("Login Success", loginStart))
		fmt.Println("Access Token: " + conn.AccessToken)
	}
	return api, nil
}
Login logs a given user into a target Skuid Platform site and returns a RestApi connection
that can be used to make HTTP requests
package platform
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"log"
	"net/http"
	"net/url"
	"strings"
	"time"
	"github.com/pkg/errors"
	"github.com/skuid/skuid-cli/httperror"
	"github.com/skuid/skuid-cli/text"
	"github.com/skuid/skuid-cli/types"
	"github.com/skuid/skuid-cli/version"
	"github.com/skuid/skuid-cli/ziputils"
)
type OAuthResponse struct {
	ExpiresIn   int    `json:"expires_in"`
	AccessToken string `json:"access_token"`
}
type JWTResponse struct {
	Token string `json:"token"`
}
type RestConnection struct {
	AccessToken          string
	APIVersion           string
	ClientId             string
	ClientSecret         string
	Host                 string
	Password             string
	Username             string
	JWT                  string
	MetadataServiceProxy *url.URL
	DataServiceProxy     *url.URL
}
type RestApi struct {
	Connection *RestConnection
}
var VERSION = version.Name