github.com/NaverCloudPlatform/ncloud-sdk-go-v2@v1.6.13/ncloud/credentials/value_provider.go (about)

     1  package credentials
     2  
     3  type ValueProvider struct {
     4  	value Value
     5  }
     6  
     7  func NewValueProviderCreds(accessKey, secretKey string) *Credentials {
     8  	p := NewValueProvider(accessKey, secretKey)
     9  	return &Credentials{
    10  		value:    p.value,
    11  		provider: p,
    12  	}
    13  }
    14  
    15  func NewValueProvider(accessKey, secretKey string) *ValueProvider {
    16  	return &ValueProvider{
    17  		value: Value{
    18  			AccessKey:  accessKey,
    19  			SecretKey:  secretKey,
    20  		},
    21  	}
    22  }
    23  
    24  func (p *ValueProvider) Name() string {
    25  	return "ValueProvider"
    26  }
    27  
    28  func (p *ValueProvider) Retrieve() (Value, error) {
    29  	return p.value, nil
    30  }