Go
Go
Example: Http.S3_FileExists method
Demonstrates theS3_FileExists method.
Chilkat Go Downloads
http := chilkat.NewHttp()
// Insert your AWS keys here:
http.SetAwsAccessKey("AWS_ACCESS_KEY")
http.SetAwsSecretKey("AWS_SECRET_KEY")
bucketName := "chilkat.ocean"
objectName := "seahorse.jpg"
http.SetAwsRegion("us-west-2")
http.SetAwsEndpoint("s3-us-west-2.amazonaws.com")
retval := http.S3_FileExists(bucketName,objectName)
if retval < 0 {
fmt.Println("Failed to check for the S3 object existence")
fmt.Println(http.LastErrorText())
http.DisposeHttp()
return
}
if retval == 0 {
fmt.Println("The S3 object does not exist.")
http.DisposeHttp()
return
}
fmt.Println("The S3 object exists.")
http.DisposeHttp()