func (llr *logListRefresherImpl) LastJSON() []byte {
	llr.updateMu.Lock()
	defer llr.updateMu.Unlock()
	if llr.lastJSON == nil {
		return []byte{}
	}
	return llr.lastJSON
}
LastJSON returns last version of Log list in JSON.
package submission
import (
	"bytes"
	"fmt"
	"net/http"
	"sync"
	"time"
	"github.com/google/certificate-transparency-go/loglist2"
	"github.com/google/certificate-transparency-go/x509util"
)
const (
	httpClientTimeout = 10 * time.Second
)
type LogListData struct {
	JSON         []byte
	List         *loglist2.LogList
	DownloadTime time.Time
}
type LogListRefresher interface {
	Refresh() (*LogListData, error)
	LastJSON() []byte
	Source() string
}
type logListRefresherImpl struct {
	updateMu sync.RWMutex
	lastJSON []byte
	path     string
	client   *http.Client
}
func NewCustomLogListRefresher(client *http.Client, llPath string) LogListRefresher {
	return &logListRefresherImpl{
		path:   llPath,
		client: client,
	}
}
func NewLogListRefresher(llPath string) LogListRefresher {
	return NewCustomLogListRefresher(&http.Client{Timeout: httpClientTimeout}, llPath)
}
func (llr *logListRefresherImpl) Refresh() (*LogListData, error) {
	llr.updateMu.Lock()
	defer llr.updateMu.Unlock()
	t := time.Now()
	json, err := x509util.ReadFileOrURL(llr.path, llr.client)
	if err != nil {
		return nil, fmt.Errorf("failed to read %q: %v", llr.path, err)
	}
	if bytes.Equal(json, llr.lastJSON) {
		return nil, nil
	}
	ll, err := loglist2.NewFromJSON(json)
	if err != nil {
		return nil, fmt.Errorf("failed to parse %q: %v", llr.path, err)
	}
	llr.lastJSON = json
	return &LogListData{JSON: json, List: ll, DownloadTime: t}, nil
}