• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang gamelift.New函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/gamelift.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: ExampleGameLift_GetInstanceAccess

func ExampleGameLift_GetInstanceAccess() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.GetInstanceAccessInput{
		FleetId:    aws.String("FleetId"),    // Required
		InstanceId: aws.String("InstanceId"), // Required
	}
	resp, err := svc.GetInstanceAccess(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)
}
开发者ID:realestate-com-au,项目名称:shush,代码行数:25,代码来源:examples_test.go


示例2: ExampleGameLift_DescribePlayerSessions

func ExampleGameLift_DescribePlayerSessions() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.DescribePlayerSessionsInput{
		GameSessionId:             aws.String("ArnStringModel"),
		Limit:                     aws.Int64(1),
		NextToken:                 aws.String("NonZeroAndMaxString"),
		PlayerId:                  aws.String("NonZeroAndMaxString"),
		PlayerSessionId:           aws.String("PlayerSessionId"),
		PlayerSessionStatusFilter: aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.DescribePlayerSessions(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)
}
开发者ID:realestate-com-au,项目名称:shush,代码行数:29,代码来源:examples_test.go


示例3: ExampleGameLift_SearchGameSessions

func ExampleGameLift_SearchGameSessions() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.SearchGameSessionsInput{
		AliasId:          aws.String("AliasId"),
		FilterExpression: aws.String("NonZeroAndMaxString"),
		FleetId:          aws.String("FleetId"),
		Limit:            aws.Int64(1),
		NextToken:        aws.String("NonZeroAndMaxString"),
		SortExpression:   aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.SearchGameSessions(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:29,代码来源:examples_test.go


示例4: ExampleGameLift_CreateGameSession

func ExampleGameLift_CreateGameSession() {
	svc := gamelift.New(session.New())

	params := &gamelift.CreateGameSessionInput{
		MaximumPlayerSessionCount: aws.Int64(1), // Required
		AliasId:                   aws.String("AliasId"),
		FleetId:                   aws.String("FleetId"),
		GameProperties: []*gamelift.GameProperty{
			{ // Required
				Key:   aws.String("GamePropertyKey"),   // Required
				Value: aws.String("GamePropertyValue"), // Required
			},
			// More values...
		},
		Name: aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.CreateGameSession(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)
}
开发者ID:CyCoreSystems,项目名称:coreos-kubernetes,代码行数:28,代码来源:examples_test.go


示例5: ExampleGameLift_UpdateAlias

func ExampleGameLift_UpdateAlias() {
	svc := gamelift.New(session.New())

	params := &gamelift.UpdateAliasInput{
		AliasId:     aws.String("AliasId"), // Required
		Description: aws.String("NonZeroAndMaxString"),
		Name:        aws.String("NonZeroAndMaxString"),
		RoutingStrategy: &gamelift.RoutingStrategy{
			FleetId: aws.String("FleetId"),
			Message: aws.String("FreeText"),
			Type:    aws.String("RoutingStrategyType"),
		},
	}
	resp, err := svc.UpdateAlias(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)
}
开发者ID:CyCoreSystems,项目名称:coreos-kubernetes,代码行数:25,代码来源:examples_test.go


示例6: ExampleGameLift_UpdateBuild

func ExampleGameLift_UpdateBuild() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.UpdateBuildInput{
		BuildId: aws.String("BuildId"), // Required
		Name:    aws.String("NonZeroAndMaxString"),
		Version: aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.UpdateBuild(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:26,代码来源:examples_test.go


示例7: ExampleGameLift_ListBuilds

func ExampleGameLift_ListBuilds() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.ListBuildsInput{
		Limit:     aws.Int64(1),
		NextToken: aws.String("NonEmptyString"),
		Status:    aws.String("BuildStatus"),
	}
	resp, err := svc.ListBuilds(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:26,代码来源:examples_test.go


示例8: ExampleGameLift_PutScalingPolicy

func ExampleGameLift_PutScalingPolicy() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.PutScalingPolicyInput{
		ComparisonOperator:    aws.String("ComparisonOperatorType"), // Required
		EvaluationPeriods:     aws.Int64(1),                         // Required
		FleetId:               aws.String("FleetId"),                // Required
		MetricName:            aws.String("MetricName"),             // Required
		Name:                  aws.String("NonZeroAndMaxString"),    // Required
		ScalingAdjustment:     aws.Int64(1),                         // Required
		ScalingAdjustmentType: aws.String("ScalingAdjustmentType"),  // Required
		Threshold:             aws.Float64(1.0),                     // Required
	}
	resp, err := svc.PutScalingPolicy(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:31,代码来源:examples_test.go


示例9: ExampleGameLift_DescribeFleetUtilization

func ExampleGameLift_DescribeFleetUtilization() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.DescribeFleetUtilizationInput{
		FleetIds: []*string{
			aws.String("FleetId"), // Required
			// More values...
		},
		Limit:     aws.Int64(1),
		NextToken: aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.DescribeFleetUtilization(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:29,代码来源:examples_test.go


示例10: ExampleGameLift_DescribeScalingPolicies

func ExampleGameLift_DescribeScalingPolicies() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.DescribeScalingPoliciesInput{
		FleetId:      aws.String("FleetId"), // Required
		Limit:        aws.Int64(1),
		NextToken:    aws.String("NonZeroAndMaxString"),
		StatusFilter: aws.String("ScalingStatusType"),
	}
	resp, err := svc.DescribeScalingPolicies(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:27,代码来源:examples_test.go


示例11: ExampleGameLift_CreatePlayerSessions

func ExampleGameLift_CreatePlayerSessions() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.CreatePlayerSessionsInput{
		GameSessionId: aws.String("GameSessionId"), // Required
		PlayerIds: []*string{ // Required
			aws.String("NonZeroAndMaxString"), // Required
			// More values...
		},
	}
	resp, err := svc.CreatePlayerSessions(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:28,代码来源:examples_test.go


示例12: ExampleGameLift_CreateBuild

func ExampleGameLift_CreateBuild() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.CreateBuildInput{
		Name:            aws.String("NonZeroAndMaxString"),
		OperatingSystem: aws.String("OperatingSystem"),
		StorageLocation: &gamelift.S3Location{
			Bucket:  aws.String("NonEmptyString"),
			Key:     aws.String("NonEmptyString"),
			RoleArn: aws.String("NonEmptyString"),
		},
		Version: aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.CreateBuild(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:31,代码来源:examples_test.go


示例13: ExampleGameLift_CreateAlias

func ExampleGameLift_CreateAlias() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.CreateAliasInput{
		Name: aws.String("NonZeroAndMaxString"), // Required
		RoutingStrategy: &gamelift.RoutingStrategy{ // Required
			FleetId: aws.String("FleetId"),
			Message: aws.String("FreeText"),
			Type:    aws.String("RoutingStrategyType"),
		},
		Description: aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.CreateAlias(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:30,代码来源:examples_test.go


示例14: ExampleGameLift_UpdateRuntimeConfiguration

func ExampleGameLift_UpdateRuntimeConfiguration() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.UpdateRuntimeConfigurationInput{
		FleetId: aws.String("FleetId"), // Required
		RuntimeConfiguration: &gamelift.RuntimeConfiguration{ // Required
			ServerProcesses: []*gamelift.ServerProcess{
				{ // Required
					ConcurrentExecutions: aws.Int64(1),                      // Required
					LaunchPath:           aws.String("NonZeroAndMaxString"), // Required
					Parameters:           aws.String("NonZeroAndMaxString"),
				},
				// More values...
			},
		},
	}
	resp, err := svc.UpdateRuntimeConfiguration(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:34,代码来源:examples_test.go


示例15: ExampleGameLift_UpdateGameSession

func ExampleGameLift_UpdateGameSession() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.UpdateGameSessionInput{
		GameSessionId:             aws.String("GameSessionId"), // Required
		MaximumPlayerSessionCount: aws.Int64(1),
		Name: aws.String("NonZeroAndMaxString"),
		PlayerSessionCreationPolicy: aws.String("PlayerSessionCreationPolicy"),
		ProtectionPolicy:            aws.String("ProtectionPolicy"),
	}
	resp, err := svc.UpdateGameSession(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:28,代码来源:examples_test.go


示例16: ExampleGameLift_UpdateFleetCapacity

func ExampleGameLift_UpdateFleetCapacity() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.UpdateFleetCapacityInput{
		FleetId:          aws.String("FleetId"), // Required
		DesiredInstances: aws.Int64(1),
		MaxSize:          aws.Int64(1),
		MinSize:          aws.Int64(1),
	}
	resp, err := svc.UpdateFleetCapacity(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:27,代码来源:examples_test.go


示例17: ExampleGameLift_UpdateFleetAttributes

func ExampleGameLift_UpdateFleetAttributes() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.UpdateFleetAttributesInput{
		FleetId:     aws.String("FleetId"), // Required
		Description: aws.String("NonZeroAndMaxString"),
		Name:        aws.String("NonZeroAndMaxString"),
		NewGameSessionProtectionPolicy: aws.String("ProtectionPolicy"),
	}
	resp, err := svc.UpdateFleetAttributes(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)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:27,代码来源:examples_test.go


示例18: ExampleGameLift_CreateFleet

func ExampleGameLift_CreateFleet() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := gamelift.New(sess)

	params := &gamelift.CreateFleetInput{
		BuildId:         aws.String("BuildId"),             // Required
		EC2InstanceType: aws.String("EC2InstanceType"),     // Required
		Name:            aws.String("NonZeroAndMaxString"), // Required
		Description:     aws.String("NonZeroAndMaxString"),
		EC2InboundPermissions: []*gamelift.IpPermission{
			{ // Required
				FromPort: aws.Int64(1),                 // Required
				IpRange:  aws.String("NonBlankString"), // Required
				Protocol: aws.String("IpProtocol"),     // Required
				ToPort:   aws.Int64(1),                 // Required
			},
			// More values...
		},
		LogPaths: []*string{
			aws.String("NonZeroAndMaxString"), // Required
			// More values...
		},
		NewGameSessionProtectionPolicy: aws.String("ProtectionPolicy"),
		ResourceCreationLimitPolicy: &gamelift.ResourceCreationLimitPolicy{
			NewGameSessionsPerCreator: aws.Int64(1),
			PolicyPeriodInMinutes:     aws.Int64(1),
		},
		RuntimeConfiguration: &gamelift.RuntimeConfiguration{
			ServerProcesses: []*gamelift.ServerProcess{
				{ // Required
					ConcurrentExecutions: aws.Int64(1),                      // Required
					LaunchPath:           aws.String("NonZeroAndMaxString"), // Required
					Parameters:           aws.String("NonZeroAndMaxString"),
				},
				// More values...
			},
		},
		ServerLaunchParameters: aws.String("NonZeroAndMaxString"),
		ServerLaunchPath:       aws.String("NonZeroAndMaxString"),
	}
	resp, err := svc.CreateFleet(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)
}
开发者ID:realestate-com-au,项目名称:shush,代码行数:57,代码来源:examples_test.go


示例19: ExampleGameLift_ResolveAlias

func ExampleGameLift_ResolveAlias() {
	svc := gamelift.New(session.New())

	params := &gamelift.ResolveAliasInput{
		AliasId: aws.String("AliasId"), // Required
	}
	resp, err := svc.ResolveAlias(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)
}
开发者ID:CyCoreSystems,项目名称:coreos-kubernetes,代码行数:18,代码来源:examples_test.go


示例20: ExampleGameLift_DescribeFleetPortSettings

func ExampleGameLift_DescribeFleetPortSettings() {
	svc := gamelift.New(session.New())

	params := &gamelift.DescribeFleetPortSettingsInput{
		FleetId: aws.String("FleetId"), // Required
	}
	resp, err := svc.DescribeFleetPortSettings(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)
}
开发者ID:CyCoreSystems,项目名称:coreos-kubernetes,代码行数:18,代码来源:examples_test.go



注:本文中的github.com/aws/aws-sdk-go/service/gamelift.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang glacier.New函数代码示例发布时间:2022-05-24
下一篇:
Golang firehose.Firehose类代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap