-
Notifications
You must be signed in to change notification settings - Fork 2
/
provider.go
21 lines (18 loc) · 883 Bytes
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package common
import tcerr "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/errors"
var (
envNotSet = tcerr.NewTencentCloudSDKError(creErr, "could not find environmental variable", "")
fileDoseNotExist = tcerr.NewTencentCloudSDKError(creErr, "could not find config file", "")
noCvmRole = tcerr.NewTencentCloudSDKError(creErr, "get cvm role name failed, Please confirm whether the role is bound", "")
)
// Provider provide credential to build client.
//
// Now there are four kinds provider:
// EnvProvider : get credential from your Variable environment
// ProfileProvider : get credential from your profile
// CvmRoleProvider : get credential from your cvm role
// RoleArnProvider : get credential from your role arn
type Provider interface {
// GetCredential get the credential interface
GetCredential() (CredentialIface, error)
}