本文整理汇总了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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}
示例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)
}