tos 2.0.0
tos: ^2.0.0 copied to clipboard
volcengine offical tos flutter sdk
Volcengine Object Storage(TOS) Flutter SDK #
import 'dart:io' show Platform;
import 'package:tos/enum.dart';
import 'package:tos/exception.dart';
import 'package:tos/tos.dart';
void main() async {
Map<String, String> envVars = Platform.environment;
TosClient client = TosClientBuilder()
.ak(envVars['TOS_ACCESS_KEY'] ?? '')
.sk(envVars['TOS_SECRET_KEY'] ?? '')
.region('cn-beijing')
.endpoint('https://tos-cn-beijing.volces.com')
.build();
var output = await client.listBuckets(ListBucketsInput());
print(output.requestId);
for(var bucket in output.buckets){
print(bucket.name);
}
}
copied to clipboard