Example for GO
Installing
go get github.com/aws/aws-sdk-go-v2/awsExample
init s3 client
func main() {
var key, secret, token, endpoint string
cfg, err := config.LoadDefaultConfig(context.TODO(),
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(key, secret, token)),
config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
return aws.Endpoint{
URL: endpoint,
}, nil
})),
)
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
client := s3.NewFromConfig(cfg)
}create bucket and put object
list buckets and list objects
Get ipfs hash and arweave hash
Last updated