func (c *Client) Close() error {
	return c.NodeTree.Close()
}
Close finalizes the acd.
package acd
import (
	"encoding/json"
	"net/http"
	"os"
	"time"
	"golang.org/x/oauth2"
	"gopkg.in/acd.v0/internal/constants"
	"gopkg.in/acd.v0/internal/log"
	"gopkg.in/acd.v0/node"
	"gopkg.in/acd.v0/token"
)
type (
	Config struct {
		TokenFile string `json:"tokenFile"`
		CacheFile string `json:"cacheFile"`
		Timeout time.Duration `json:"timeout"`
	}
	Client struct {
		NodeTree *node.Tree
		config      *Config
		httpClient  *http.Client
		cacheFile   string
		metadataURL string
		contentURL  string
	}
	endpointResponse struct {
		ContentURL     string `json:"contentUrl"`
		MetadataURL    string `json:"metadataUrl"`
		CustomerExists bool   `json:"customerExists"`
	}
)
const endpointURL = "https://drive.amazonaws.com/drive/v1/account/endpoint"
func New(configFile string) (*Client, error) {
	config, err := loadConfig(configFile)
	if err != nil {
		return nil, err
	}
	ts, err := token.New(config.TokenFile)
	if err != nil {
		return nil, err
	}
	c := &Client{
		config:    config,
		cacheFile: config.CacheFile,
		httpClient: &http.Client{
			Timeout: config.Timeout,
			Transport: &oauth2.Transport{
				Source: oauth2.ReuseTokenSource(nil, ts),
			},
		},
	}
	if err := setEndpoints(c); err != nil {
		return nil, err
	}
	return c, nil
}