本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/cloudsearch.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ExampleCloudSearch_UpdateAvailabilityOptions
func ExampleCloudSearch_UpdateAvailabilityOptions() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.UpdateAvailabilityOptionsInput{
DomainName: aws.String("DomainName"), // Required
MultiAZ: aws.Bool(true), // Required
}
resp, err := svc.UpdateAvailabilityOptions(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例2: ExampleCloudSearch_DefineSuggester
func ExampleCloudSearch_DefineSuggester() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.DefineSuggesterInput{
DomainName: aws.String("DomainName"), // Required
Suggester: &cloudsearch.Suggester{ // Required
DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
SourceField: aws.String("FieldName"), // Required
FuzzyMatching: aws.String("SuggesterFuzzyMatching"),
SortExpression: aws.String("String"),
},
SuggesterName: aws.String("StandardName"), // Required
},
}
resp, err := svc.DefineSuggester(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例3: ExampleCloudSearch_UpdateScalingParameters
func ExampleCloudSearch_UpdateScalingParameters() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.UpdateScalingParametersInput{
DomainName: aws.String("DomainName"), // Required
ScalingParameters: &cloudsearch.ScalingParameters{ // Required
DesiredInstanceType: aws.String("PartitionInstanceType"),
DesiredPartitionCount: aws.Int64(1),
DesiredReplicationCount: aws.Int64(1),
},
}
resp, err := svc.UpdateScalingParameters(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例4: ExampleCloudSearch_UpdateServiceAccessPolicies
func ExampleCloudSearch_UpdateServiceAccessPolicies() {
svc := cloudsearch.New(nil)
params := &cloudsearch.UpdateServiceAccessPoliciesInput{
AccessPolicies: aws.String("PolicyDocument"), // Required
DomainName: aws.String("DomainName"), // Required
}
resp, err := svc.UpdateServiceAccessPolicies(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 always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例5: ExampleCloudSearch_DeleteSuggester
func ExampleCloudSearch_DeleteSuggester() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.DeleteSuggesterInput{
DomainName: aws.String("DomainName"), // Required
SuggesterName: aws.String("StandardName"), // Required
}
resp, err := svc.DeleteSuggester(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例6: ExampleCloudSearch_DescribeSuggesters
func ExampleCloudSearch_DescribeSuggesters() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.DescribeSuggestersInput{
DomainName: aws.String("DomainName"), // Required
Deployed: aws.Bool(true),
SuggesterNames: []*string{
aws.String("StandardName"), // Required
// More values...
},
}
resp, err := svc.DescribeSuggesters(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例7: ExampleCloudSearch_UpdateScalingParameters
func ExampleCloudSearch_UpdateScalingParameters() {
svc := cloudsearch.New(nil)
params := &cloudsearch.UpdateScalingParametersInput{
DomainName: aws.String("DomainName"), // Required
ScalingParameters: &cloudsearch.ScalingParameters{ // Required
DesiredInstanceType: aws.String("PartitionInstanceType"),
DesiredPartitionCount: aws.Int64(1),
DesiredReplicationCount: aws.Int64(1),
},
}
resp, err := svc.UpdateScalingParameters(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 always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例8: ExampleCloudSearch_DescribeSuggesters
func ExampleCloudSearch_DescribeSuggesters() {
svc := cloudsearch.New(nil)
params := &cloudsearch.DescribeSuggestersInput{
DomainName: aws.String("DomainName"), // Required
Deployed: aws.Bool(true),
SuggesterNames: []*string{
aws.String("StandardName"), // Required
// More values...
},
}
resp, err := svc.DescribeSuggesters(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 always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例9: ExampleCloudSearch_DefineSuggester
func ExampleCloudSearch_DefineSuggester() {
svc := cloudsearch.New(nil)
params := &cloudsearch.DefineSuggesterInput{
DomainName: aws.String("DomainName"), // Required
Suggester: &cloudsearch.Suggester{ // Required
DocumentSuggesterOptions: &cloudsearch.DocumentSuggesterOptions{ // Required
SourceField: aws.String("FieldName"), // Required
FuzzyMatching: aws.String("SuggesterFuzzyMatching"),
SortExpression: aws.String("String"),
},
SuggesterName: aws.String("StandardName"), // Required
},
}
resp, err := svc.DefineSuggester(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 always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
示例10: ExampleCloudSearch_UpdateServiceAccessPolicies
func ExampleCloudSearch_UpdateServiceAccessPolicies() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.UpdateServiceAccessPoliciesInput{
AccessPolicies: aws.String("PolicyDocument"), // Required
DomainName: aws.String("DomainName"), // Required
}
resp, err := svc.UpdateServiceAccessPolicies(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例11: ExampleCloudSearch_DeleteIndexField
func ExampleCloudSearch_DeleteIndexField() {
svc := cloudsearch.New(nil)
params := &cloudsearch.DeleteIndexFieldInput{
DomainName: aws.String("DomainName"), // Required
IndexFieldName: aws.String("DynamicFieldName"), // Required
}
resp, err := svc.DeleteIndexField(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 always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
示例12: ExampleCloudSearch_DefineAnalysisScheme
func ExampleCloudSearch_DefineAnalysisScheme() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := cloudsearch.New(sess)
params := &cloudsearch.DefineAnalysisSchemeInput{
AnalysisScheme: &cloudsearch.AnalysisScheme{ // Required
AnalysisSchemeLanguage: aws.String("AnalysisSchemeLanguage"), // Required
AnalysisSchemeName: aws.String("StandardName"), // Required
AnalysisOptions: &cloudsearch.AnalysisOptions{
AlgorithmicStemming: aws.String("AlgorithmicStemming"),
JapaneseTokenizationDictionary: aws.String("String"),
StemmingDictionary: aws.String("String"),
Stopwords: aws.String("String"),
Synonyms: aws.String("String"),
},
},
DomainName: aws.String("DomainName"), // Required
}
resp, err := svc.DefineAnalysisScheme(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例13: ExampleCloudSearch_ListDomainNames
func ExampleCloudSearch_ListDomainNames() {
svc := cloudsearch.New(nil)
var params *cloudsearch.ListDomainNamesInput
resp, err := svc.ListDomainNames(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例14: ExampleCloudSearch_DescribeScalingParameters
func ExampleCloudSearch_DescribeScalingParameters() {
svc := cloudsearch.New(session.New())
params := &cloudsearch.DescribeScalingParametersInput{
DomainName: aws.String("DomainName"), // Required
}
resp, err := svc.DescribeScalingParameters(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
示例15: ExampleCloudSearch_IndexDocuments
func ExampleCloudSearch_IndexDocuments() {
svc := cloudsearch.New(nil)
params := &cloudsearch.IndexDocumentsInput{
DomainName: aws.String("DomainName"), // Required
}
resp, err := svc.IndexDocuments(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}