本文整理汇总了Golang中github.com/datacratic/aws-sdk-go/service/elasticache.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleElastiCache_ResetCacheParameterGroup
func ExampleElastiCache_ResetCacheParameterGroup() {
svc := elasticache.New(nil)
params := &elasticache.ResetCacheParameterGroupInput{
CacheParameterGroupName: aws.String("String"), // Required
ParameterNameValues: []*elasticache.ParameterNameValue{ // Required
&elasticache.ParameterNameValue{ // Required
ParameterName: aws.String("String"),
ParameterValue: aws.String("String"),
},
// More values...
},
ResetAllParameters: aws.Boolean(true),
}
resp, err := svc.ResetCacheParameterGroup(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例2: ExampleElastiCache_DescribeEvents
func ExampleElastiCache_DescribeEvents() {
svc := elasticache.New(nil)
params := &elasticache.DescribeEventsInput{
Duration: aws.Long(1),
EndTime: aws.Time(time.Now()),
Marker: aws.String("String"),
MaxRecords: aws.Long(1),
SourceIdentifier: aws.String("String"),
SourceType: aws.String("SourceType"),
StartTime: aws.Time(time.Now()),
}
resp, err := svc.DescribeEvents(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例3: ExampleElastiCache_DescribeReservedCacheNodesOfferings
func ExampleElastiCache_DescribeReservedCacheNodesOfferings() {
svc := elasticache.New(nil)
params := &elasticache.DescribeReservedCacheNodesOfferingsInput{
CacheNodeType: aws.String("String"),
Duration: aws.String("String"),
Marker: aws.String("String"),
MaxRecords: aws.Long(1),
OfferingType: aws.String("String"),
ProductDescription: aws.String("String"),
ReservedCacheNodesOfferingID: aws.String("String"),
}
resp, err := svc.DescribeReservedCacheNodesOfferings(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例4: ExampleElastiCache_AddTagsToResource
func ExampleElastiCache_AddTagsToResource() {
svc := elasticache.New(nil)
params := &elasticache.AddTagsToResourceInput{
ResourceName: aws.String("String"), // Required
Tags: []*elasticache.Tag{ // Required
&elasticache.Tag{ // Required
Key: aws.String("String"),
Value: aws.String("String"),
},
// More values...
},
}
resp, err := svc.AddTagsToResource(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例5: ExampleElastiCache_CreateCacheCluster
func ExampleElastiCache_CreateCacheCluster() {
svc := elasticache.New(nil)
params := &elasticache.CreateCacheClusterInput{
CacheClusterID: aws.String("String"), // Required
AZMode: aws.String("AZMode"),
AutoMinorVersionUpgrade: 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"),
NumCacheNodes: aws.Long(1),
Port: aws.Long(1),
PreferredAvailabilityZone: aws.String("String"),
PreferredAvailabilityZones: []*string{
aws.String("String"), // Required
// More values...
},
PreferredMaintenanceWindow: aws.String("String"),
ReplicationGroupID: 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.CreateCacheCluster(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例6: ExampleElastiCache_ListTagsForResource
func ExampleElastiCache_ListTagsForResource() {
svc := elasticache.New(nil)
params := &elasticache.ListTagsForResourceInput{
ResourceName: aws.String("String"), // Required
}
resp, err := svc.ListTagsForResource(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例7: ExampleElastiCache_DeleteCacheSecurityGroup
func ExampleElastiCache_DeleteCacheSecurityGroup() {
svc := elasticache.New(nil)
params := &elasticache.DeleteCacheSecurityGroupInput{
CacheSecurityGroupName: aws.String("String"), // Required
}
resp, err := svc.DeleteCacheSecurityGroup(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例8: ExampleElastiCache_DeleteCacheCluster
func ExampleElastiCache_DeleteCacheCluster() {
svc := elasticache.New(nil)
params := &elasticache.DeleteCacheClusterInput{
CacheClusterID: aws.String("String"), // Required
FinalSnapshotIdentifier: aws.String("String"),
}
resp, err := svc.DeleteCacheCluster(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例9: ExampleElastiCache_PurchaseReservedCacheNodesOffering
func ExampleElastiCache_PurchaseReservedCacheNodesOffering() {
svc := elasticache.New(nil)
params := &elasticache.PurchaseReservedCacheNodesOfferingInput{
ReservedCacheNodesOfferingID: aws.String("String"), // Required
CacheNodeCount: aws.Long(1),
ReservedCacheNodeID: aws.String("String"),
}
resp, err := svc.PurchaseReservedCacheNodesOffering(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例10: ExampleElastiCache_DescribeEngineDefaultParameters
func ExampleElastiCache_DescribeEngineDefaultParameters() {
svc := elasticache.New(nil)
params := &elasticache.DescribeEngineDefaultParametersInput{
CacheParameterGroupFamily: aws.String("String"), // Required
Marker: aws.String("String"),
MaxRecords: aws.Long(1),
}
resp, err := svc.DescribeEngineDefaultParameters(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例11: ExampleElastiCache_ModifyReplicationGroup
func ExampleElastiCache_ModifyReplicationGroup() {
svc := elasticache.New(nil)
params := &elasticache.ModifyReplicationGroupInput{
ReplicationGroupID: aws.String("String"), // Required
ApplyImmediately: aws.Boolean(true),
AutoMinorVersionUpgrade: aws.Boolean(true),
AutomaticFailoverEnabled: aws.Boolean(true),
CacheParameterGroupName: aws.String("String"),
CacheSecurityGroupNames: []*string{
aws.String("String"), // Required
// More values...
},
EngineVersion: aws.String("String"),
NotificationTopicARN: aws.String("String"),
NotificationTopicStatus: aws.String("String"),
PreferredMaintenanceWindow: aws.String("String"),
PrimaryClusterID: aws.String("String"),
ReplicationGroupDescription: aws.String("String"),
SecurityGroupIDs: []*string{
aws.String("String"), // Required
// More values...
},
SnapshotRetentionLimit: aws.Long(1),
SnapshotWindow: aws.String("String"),
SnapshottingClusterID: aws.String("String"),
}
resp, err := svc.ModifyReplicationGroup(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例12: ExampleElastiCache_DescribeCacheClusters
func ExampleElastiCache_DescribeCacheClusters() {
svc := elasticache.New(nil)
params := &elasticache.DescribeCacheClustersInput{
CacheClusterID: aws.String("String"),
Marker: aws.String("String"),
MaxRecords: aws.Long(1),
ShowCacheNodeInfo: aws.Boolean(true),
}
resp, err := svc.DescribeCacheClusters(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例13: ExampleElastiCache_RebootCacheCluster
func ExampleElastiCache_RebootCacheCluster() {
svc := elasticache.New(nil)
params := &elasticache.RebootCacheClusterInput{
CacheClusterID: aws.String("String"), // Required
CacheNodeIDsToReboot: []*string{ // Required
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.RebootCacheCluster(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例14: ExampleElastiCache_ModifyCacheSubnetGroup
func ExampleElastiCache_ModifyCacheSubnetGroup() {
svc := elasticache.New(nil)
params := &elasticache.ModifyCacheSubnetGroupInput{
CacheSubnetGroupName: aws.String("String"), // Required
CacheSubnetGroupDescription: aws.String("String"),
SubnetIDs: []*string{
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.ModifyCacheSubnetGroup(params)
if awserr := aws.Error(err); awserr != nil {
// A service error occurred.
fmt.Println("Error:", awserr.Code, awserr.Message)
} else if err != nil {
// A non-service error occurred.
panic(err)
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}