本文整理汇总了Golang中github.com/awslabs/aws-sdk-go/service/elasticache.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ExampleElastiCache_ModifyCacheParameterGroup
func ExampleElastiCache_ModifyCacheParameterGroup() {
svc := elasticache.New(nil)
params := &elasticache.ModifyCacheParameterGroupInput{
CacheParameterGroupName: aws.String("String"), // Required
ParameterNameValues: []*elasticache.ParameterNameValue{ // Required
&elasticache.ParameterNameValue{ // Required
ParameterName: aws.String("String"),
ParameterValue: aws.String("String"),
},
// More values...
},
}
resp, err := svc.ModifyCacheParameterGroup(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:33,代码来源:examples_test.go
示例2: ExampleElastiCache_ListTagsForResource
func ExampleElastiCache_ListTagsForResource() {
svc := elasticache.New(nil)
params := &elasticache.ListTagsForResourceInput{
ResourceName: aws.String("String"), // Required
}
resp, err := svc.ListTagsForResource(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:26,代码来源:examples_test.go
示例3: ExampleElastiCache_DescribeSnapshots
func ExampleElastiCache_DescribeSnapshots() {
svc := elasticache.New(nil)
params := &elasticache.DescribeSnapshotsInput{
CacheClusterID: aws.String("String"),
Marker: aws.String("String"),
MaxRecords: aws.Long(1),
SnapshotName: aws.String("String"),
SnapshotSource: aws.String("String"),
}
resp, err := svc.DescribeSnapshots(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:30,代码来源:examples_test.go
示例4: ExampleElastiCache_DeleteReplicationGroup
func ExampleElastiCache_DeleteReplicationGroup() {
svc := elasticache.New(nil)
params := &elasticache.DeleteReplicationGroupInput{
ReplicationGroupID: aws.String("String"), // Required
FinalSnapshotIdentifier: aws.String("String"),
RetainPrimaryCluster: aws.Boolean(true),
}
resp, err := svc.DeleteReplicationGroup(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:28,代码来源:examples_test.go
示例5: ExampleElastiCache_ModifyCacheCluster
func ExampleElastiCache_ModifyCacheCluster() {
svc := elasticache.New(nil)
params := &elasticache.ModifyCacheClusterInput{
CacheClusterID: aws.String("String"), // Required
AZMode: aws.String("AZMode"),
ApplyImmediately: aws.Boolean(true),
AutoMinorVersionUpgrade: aws.Boolean(true),
CacheNodeIDsToRemove: []*string{
aws.String("String"), // Required
// More values...
},
CacheParameterGroupName: aws.String("String"),
CacheSecurityGroupNames: []*string{
aws.String("String"), // Required
// More values...
},
EngineVersion: aws.String("String"),
NewAvailabilityZones: []*string{
aws.String("String"), // Required
// More values...
},
NotificationTopicARN: aws.String("String"),
NotificationTopicStatus: aws.String("String"),
NumCacheNodes: aws.Long(1),
PreferredMaintenanceWindow: aws.String("String"),
SecurityGroupIDs: []*string{
aws.String("String"), // Required
// More values...
},
SnapshotRetentionLimit: aws.Long(1),
SnapshotWindow: aws.String("String"),
}
resp, err := svc.ModifyCacheCluster(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:53,代码来源:examples_test.go
示例6: ExampleElastiCache_CreateReplicationGroup
func ExampleElastiCache_CreateReplicationGroup() {
svc := elasticache.New(nil)
params := &elasticache.CreateReplicationGroupInput{
ReplicationGroupDescription: aws.String("String"), // Required
ReplicationGroupID: aws.String("String"), // Required
AutoMinorVersionUpgrade: aws.Boolean(true),
AutomaticFailoverEnabled: aws.Boolean(true),
CacheNodeType: aws.String("String"),
CacheParameterGroupName: aws.String("String"),
CacheSecurityGroupNames: []*string{
aws.String("String"), // Required
// More values...
},
CacheSubnetGroupName: aws.String("String"),
Engine: aws.String("String"),
EngineVersion: aws.String("String"),
NotificationTopicARN: aws.String("String"),
NumCacheClusters: aws.Long(1),
Port: aws.Long(1),
PreferredCacheClusterAZs: []*string{
aws.String("String"), // Required
// More values...
},
PreferredMaintenanceWindow: aws.String("String"),
PrimaryClusterID: aws.String("String"),
SecurityGroupIDs: []*string{
aws.String("String"), // Required
// More values...
},
SnapshotARNs: []*string{
aws.String("String"), // Required
// More values...
},
SnapshotName: aws.String("String"),
SnapshotRetentionLimit: aws.Long(1),
SnapshotWindow: aws.String("String"),
Tags: []*elasticache.Tag{
&elasticache.Tag{ // Required
Key: aws.String("String"),
Value: aws.String("String"),
},
// More values...
},
}
resp, err := svc.CreateReplicationGroup(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, The SDK should alwsy return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:65,代码来源:examples_test.go
示例7: TestInterface
func TestInterface(t *testing.T) {
assert.Implements(t, (*elasticacheiface.ElastiCacheAPI)(nil), elasticache.New(nil))
}
开发者ID:navneet-flipkart,项目名称:confd,代码行数:3,代码来源:interface_test.go
示例8: init
func init() {
Before("@elasticache", func() {
World["client"] = elasticache.New(nil)
})
}
开发者ID:ninefive,项目名称:confd,代码行数:5,代码来源:client.go
注:本文中的github.com/awslabs/aws-sdk-go/service/elasticache.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论