func FetchExistingRevocations()

in entryMaker/oneCRL/oneCRL.go [106:127]


func FetchExistingRevocations(url string) (*Records, error) {
	conf := config.GetConfig()

	if len(url) == 0 {
		return nil, errors.New("No URL was specified")
	}

	if "yes" == conf.OneCRLVerbose {
		fmt.Printf("Got URL data\n")
	}

	res := new(Records)
	if data, err := getDataFromURL(url, conf); nil != err {
		return nil, errors.New(fmt.Sprintf("problem loading existing data from URL %s", err))
	} else {
		if err := json.Unmarshal(data, res); nil != err {
			return nil, err
		} else {
			return res, nil
		}
	}
}