Exemple #1
0
func Upload(path string, data []byte) (string, error) {
	err := idcf.Put(path, data, "image/png")
	if err != nil {
		return "", err
	}

	return "https://" + idcf.BucketName() + ".ds.jp-east.idcfcloud.com/" + path, nil
}
Exemple #2
0
func Exists(path string) (bool, string, error) {
	exist, err := idcf.Exists(path)
	if err != nil {
		return false, "", err
	}

	if exist {
		return true, "https://" + idcf.BucketName() + ".ds.jp-east.idcfcloud.com/" + path, nil
	}

	return false, "", nil
}