(Go) Wasabi Delete Bucket
Demonstrates how to delete a new Wasabi bucket.
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := chilkat.NewHttp()
// Insert your access key here:
http.SetAwsAccessKey("access-key")
// Insert your secret key here:
http.SetAwsSecretKey("secret-key")
// To delete a bucket located in a different region, use the domain for that region, such as "s3.eu-central-1.wasabisys.com"
http.SetAwsEndpoint("s3.wasabisys.com")
http.SetKeepResponseBody(true)
success := http.S3_DeleteBucket("chilkat-wasabi-testbucket")
if success != true {
fmt.Println(http.LastErrorText())
// Also examine the error response body from Wasabi:
fmt.Println(http.LastResponseBody())
}
else {
fmt.Println("Bucket deleted.")
}
http.DisposeHttp()
|