package qiniu

import (
	"github.com/qiniu/api.v7/v7/auth"
	"github.com/qiniu/api.v7/v7/storage"
)

func BucketGetDomain(bucketName string) (string, error) {
	mac := auth.New(AK, SK)

	cfg := storage.Config{UseHTTPS: false}
	bucketManager := storage.NewBucketManager(mac, &cfg)
	b, err := bucketManager.ListBucketDomains(bucketName)
	if err != nil {
		return "", err
	}
	return b[0].Domain, nil
}
