func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
	var auth clientauth.Info
	if _, err := os.Stat(path); os.IsNotExist(err) {
		auth = *a.Prompt()
		data, err := json.Marshal(auth)
		if err != nil {
			return &auth, err
		}
		err = ioutil.WriteFile(path, data, 0600)
		return &auth, err
	}
	authPtr, err := clientauth.LoadFromFile(path)
	if err != nil {
		return nil, err
	}
	return authPtr, nil
}
LoadAuth parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist.
package clientcmd
import (
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/clientauth"
)
type AuthLoader interface {
	LoadAuth(path string) (*clientauth.Info, error)
}
type defaultAuthLoader struct{}
func (*defaultAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
	return clientauth.LoadFromFile(path)
}
type PromptingAuthLoader struct {
	reader io.Reader
}