当前位置: 首页>>代码示例>>Golang>>正文


Golang gamelift.New函数代码示例

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


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


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