All Products
Search
Document Center

Object Storage Service:Advanced configurations for OSS SDK for Go V2

Last Updated:Dec 19, 2024

This topic provides an overview of the advanced configurations for OSS SDK for Go V2, including the configurations of access credentials, configuring endpoints, and OSSClient instances, which ensure data security during transmission and optimise the performance of clients.

Configure access credentials

To use OSS SDK for Go to initiate a request, you must configure access credentials. Access credentials are used by Alibaba Cloud services to verify your identity and access permissions. We recommend that you select an appropriate authentication and authorization method based on your actual scenario to ensure data security and access legitimacy. You can use different methods to configure access credentials in different scenarios and properly manage and protect your AccessKey pair. For more information, see configure access credentials.

Configure domain names

OSS supports multiple methods to access resources, such as using public endpoints, internal endpoints and custom domain names. Proper configuration of domain names can reduce network latency, improve availability, and manage and control traffic effectively. For more information, see Configure domain names.

Configure an OSSClient instance

You are required to initialize and configure an OSSClient instance before you use OSS SDK for Go to perform operations, such as creating/deleting buckets and uploading/downloading objects. You can create and configure an OSSClient instance, including configuring options such as network timeouts and retries, to meet the requirements of different scenarios. For more information, see Configure an OSSClient instance.