func (c *AuthCache) Unset(keys ...string) {
	for _, key := range keys {
		c.unset(key)
	}
}
Unset unsets keys in the auth cache.
package util
import (
	"encoding/json"
	"os"
	"path/filepath"
	"strings"
	"golang.org/x/oauth2"
)
type AuthData struct {
	OAuthToken *oauth2.Token          `json:"oauth_token,omitempty"`
	APIKey     string                 `json:"api_key,omitempty"`
	Hosts      []string               `json:"hosts,omitempty"`
	Other      map[string]interface{} `json:"other,omitempty"`
}
type AuthCache struct {
	data struct {
		AuthData
		ByID map[string]*AuthData `json:"by_id"`
	}
	id      string
	changed bool
}
func (c AuthCache) ForID(id string) AuthCache {
	clone := c
	clone.id = id
	return clone
}
func (c *AuthCache) getData() *AuthData {
	data := &c.data.AuthData
	if c.id != "" {
		if c.data.ByID == nil {
			c.data.ByID = make(map[string]*AuthData)
		}
		var ok bool
		data, ok = c.data.ByID[c.id]
		if !ok {
			data = &AuthData{}
			c.data.ByID[c.id] = data
		}
	}
	return data
}
func (c *AuthCache) Get(key string) interface{} {
	authData := c.getData()
	switch key {
	case "oauth_token":
		return authData.OAuthToken
	case "api_key":
		return authData.APIKey
	case "hosts":
		return authData.Hosts
	default:
		return getFromMap(authData.Other, strings.Split(key, "."))
	}
}
func getFromMap(m map[string]interface{}, path []string) interface{} {
	item := m[path[0]]
	if len(path) == 1 {
		return item
	}
	if m, ok := item.(map[string]interface{}); ok {
		return getFromMap(m, path[1:])
	}
	return nil
}
func (c *AuthCache) Set(key string, value interface{}) {
	authData := c.getData()
	switch key {
	case "oauth_token":
		authData.OAuthToken = value.(*oauth2.Token)
	case "api_key":
		authData.APIKey = value.(string)
	case "hosts":
		authData.Hosts = value.([]string)
	default:
		if authData.Other == nil {
			authData.Other = make(map[string]interface{})
		}
		setInMap(authData.Other, strings.Split(key, "."), value)
	}
	c.changed = true
}