×
Home
About
Trails
Contacts
Quiz
Here is where the question is displayed
Answer 1
Answer 2
Answer 3
Answer 4


The CloudMapServiceDecorator allows your service to register a service instance for your application.
For example, an application that provisions a SQS queue and an AWS Lambda function that consumes messages from that queue may need a way for the Lambda function to discover the dynamically provisioned queue.
Sparta supports an environment-based discovery service but that discovery is limited to a single Service.
The CloudMapServiceDecorator
leverages the CloudMap service to support intra- and inter-service resource discovery.
The first step is to create an instance of the CloudMapServiceDecorator
type that can be used to register additional resources.
import (
spartaDecorators "github.com/mweagle/Sparta/v3/decorator"
)
func main() {
...
cloudMapDecorator, cloudMapDecoratorErr := spartaDecorators.NewCloudMapServiceDecorator(gocf.String("SpartaServices"),
gocf.String("SpartaSampleCloudMapService"))
...
}
The first argument is the Cloud Map Namespace ID value to which the service (MyService) will publish.
The decorator satisfies the ServiceDecoratorHookHandler. The instance should be provided as a WorkflowHooks.ServiceDecorators
element to MainEx
as in:
func main() {
// ...
cloudMapDecorator, cloudMapDecoratorErr := spartaDecorators.NewCloudMapServiceDecorator(gocf.String("SpartaServices"),
gocf.String("SpartaSampleCloudMapService"))
workflowHooks := &sparta.WorkflowHooks{
ServiceDecorators: []sparta.ServiceDecoratorHookHandler{
cloudMapDecorator,
},
}
// ...
err := sparta.MainEx(awsName,
"Simple Sparta application that demonstrates core functionality",
lambdaFunctions,
nil,
nil,
workflowHooks,
false)
}
The returned CloudMapServiceDecorator
instance satisfies the ServiceDecoratorHookHandler interface. When invoked, it updates the content of you CloudFormation template with the resources and permissions as described below. CloudMapServiceDecorator
implicitly creates a new AWS::ServiceDiscovery::Service resource to which your resources will be published.
The CloudMapServiceDecorator.PublishLambda
function publishes Lambda function information to the (NamespaceID, ServiceID) pair.
lambdaFn, _ := sparta.NewAWSLambda("Hello World",
helloWorld,
sparta.IAMRoleDefinition{})
cloudMapDecorator.PublishLambda("lambdaDiscoveryName", lambdaFn, nil)
The default properties published include the Lambda Outputs and Type information:
{
"Id": "CloudMapResbe2b7c536074312c-VuIPjfjuFaoc",
"Attributes": {
"Arn": "arn:aws:lambda:us-west-2:123412341234:function:MyHelloWorldStack-123412341234_Hello_World",
"Name": "lambdaDiscoveryName",
"Ref": "MyHelloWorldStack-123412341234_Hello_World",
"Type": "AWS::Lambda::Function"
}
}
The CloudMapServiceDecorator.PublishResource
function publishes arbitrary CloudFormation resource outputs information to the (NamespaceID, ServiceID) pair.
For instance, to publish SQS information in the context of a standard ServiceDecorator
func createSQSResourceDecorator(cloudMapDecorator *spartaDecorators.CloudMapServiceDecorator) sparta.ServiceDecoratorHookHandler {
return sparta.ServiceDecoratorHookFunc(func(context map[string]interface{},
serviceName string,
template *gocf.Template,
S3Bucket string,
S3Key string,
buildID string,
awsSession *session.Session,
noop bool,
logger *zerolog.Logger) error {
sqsResource := &gocf.SQSQueue{}
template.AddResource("SQSResource", sqsResource)
return cloudMapDecorator.PublishResource("SQSResource",
"SQSResource",
sqsResource,
nil)
})
}
The default properties published include the SQS Outputs and Type information:
{
"Id": "CloudMapRes21cf275e8bbbe136-CqWZ27gdLHf8",
"Attributes": {
"Arn": "arn:aws:sqs:us-west-2:123412341234:MyHelloWorldStack-123412341234-SQSResource-S9DWKIFKP14U",
"Name": "SQSResource",
"QueueName": "MyHelloWorldStack-123412341234-SQSResource-S9DWKIFKP14U",
"Ref": "https://sqs.us-west-2.amazonaws.com/123412341234/MyHelloWorldStack-123412341234-SQSResource-S9DWKIFKP14U",
"Type": "AWS::SQS::Queue"
}
}
Publishing instances to CloudMap only makes them available for other services to discover them. Call the EnableDiscoverySupport
with your *sparta.LambdaAWSInfo
instance as the only argument. This function updates your Lambda function’s environment to include the provisioned ServiceInstance and also the IAM role privileges to authorize:
For instance:
func main() {
// ...
lambdaFn, _ := sparta.NewAWSLambda("Hello World",
helloWorld,
sparta.IAMRoleDefinition{})
// ...
cloudMapDecorator.EnableDiscoverySupport(lambdaFn)
// ...
}
With the resources published and the lambda role properly updated, the last step is to dynamically discover the provisioned resources via CloudMap. Call DiscoverInstancesWithContext
with the the set of key-value pairs to use for discovery as below:
func helloWorld(ctx context.Context) (string, error) {
// ...
props := map[string]string{
"Type": "AWS::SQS::Queue",
}
results, resultsErr := spartaDecorators.DiscoverInstancesWithContext(ctx,
props,
logger)
logger.Info().
Interface("Instances", results).
Err(resultsErr).
Msg("Discovered instances")
// ...
}
Given the previous example of a single lambda function and an SQS-queue provisioning decorator, the DiscoverInstancesWithContext
would return the matching instance with data similar to:
{
"Instances": [
{
"Attributes": {
"Arn": "arn:aws:sqs:us-west-2:123412341234:MyHelloWorldStack-123412341234-SQSResource-S9DWKIFKP14U",
"Name": "SQSResource",
"QueueName": "MyHelloWorldStack-123412341234-SQSResource-S9DWKIFKP14U",
"Ref": "https://sqs.us-west-2.amazonaws.com/123412341234/MyHelloWorldStack-123412341234-SQSResource-S9DWKIFKP14U",
"Type": "AWS::SQS::Queue"
},
"HealthStatus": "HEALTHY",
"InstanceId": "CloudMapResd1a507076543ccd0-Fln1ITi5cf0y",
"NamespaceName": "SpartaServices",
"ServiceName": "SpartaSampleCloudMapService"
}
]
}


This is a test page for the Server Timing API (
link
) As of Chrome 66, resource-timing entries don't report any serverTiming values even though they're visible in devTools


|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
| Interface Summary | |
| AccessFlags | |
| CharStream | This interface describes a character stream that maintains line and column number positions of the characters. |
| JavaParserConstants | |
| JavaParserTreeConstants | |
| JavaParserVisitor | |
| Node |
| Exception Summary | |
| ParseException | This exception is thrown when parse errors are encountered. |
| TokenMgrError |
|
|||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


--- layout: post title: Cosmic Baker Attacks Phone Mast! date: 2004-12-23 00:00:00 categories: hilarity mobile ---
Cosmic Baker Attacks Phone Mast!


| deleteAllVisibleCookies |
|
|
| type |
querytext |
jane |
| clickAndWait |
//input[@value='Search'] |
|
| assertTitle |
jane - VIVO Search Results |
|
| verifyElementPresent |
link=people |
|
| verifyElementPresent |
link=Faculty, Jane |
|
| verifyTextPresent |
Faculty, Jane Assistant Professor |
|
| type |
querytext |
faculty |
| clickAndWait |
//input[@value='Search'] |
|
| assertTitle |
faculty - VIVO Search Results |
|
| verifyElementPresent |
link=people |
|
| verifyElementPresent |
link=Faculty, Jane |
|
| verifyTextPresent |
Faculty, Jane Assistant Professor |
|
| verifyElementPresent |
link=Librarian, Lily Lou |
|
| verifyText |
//div[@id='wrapper-content']/div/ul/li[2]/span |
Assistant Librarian |
| type |
querytext |
jane faculty |
| clickAndWait |
//input[@value='Search'] |
|
| assertTitle |
jane faculty - VIVO Search Results |
|
| verifyElementPresent |
link=people |
|
| verifyElementPresent |
link=Faculty, Jane |
|
| verifyTextPresent |
Faculty, Jane Assistant Professor |
|
| type |
querytext |
lily |
| clickAndWait |
//input[@value='Search'] |
|
| assertTitle |
lily - VIVO Search Results |
|
| verifyElementPresent |
link=people |
|
| verifyElementPresent |
link=Librarian, Lily Lou |
|
| verifyTextPresent |
Librarian, Lily Lou Assistant Librarian |
|
| type |
querytext |
librarian |
| clickAndWait |
//input[@value='Search'] |
|
| assertTitle |
librarian - VIVO Search Results |
|
| verifyElementPresent |
link=people |
|
| verifyElementPresent |
link=Librarian, Lily Lou |
|
| verifyTextPresent |
Librarian, Lily Lou Assistant Librarian |
|
| type |
querytext |
lily librarian |
| clickAndWait |
//input[@value='Search'] |
|
| assertTitle |
lily librarian - VIVO Search Results |
|
| verifyElementPresent |
link=people |
|
| verifyElementPresent |
link=Librarian, Lily Lou |
|
| verifyTextPresent |
Librarian, Lily Lou Assistant Librarian |
|
| clickAndWait |
link=Home |
|
| assertTitle |
VIVO |
|


α
β
β*
n
Church
Scott
Reset
Main
Input
Definitions
Looks like your browser is outdated. Consider
updating
for a better experience


Toggle navigation
Guna
Log Out
Edit Woven - jkwher
View
Back
Edit Design Card
Customer
Select Customer
Jithender
Gddfgd
Fsdfsdf
Vdfdf
Label
Date
Designer
Select Designer
Fsdfsdf
Xvxcv
Sales Rep
Select Sales Rep
Bcbcvb
Weaver
Select
Muller
Airjet 1.2 Mt
Airjet 1.6 mt
Select
Muller
Airjet 1.2 Mt
Airjet 1.6 mt
Warp
Select Warp
Sdfsdf
Finishing
Select finishing
Ascas
Notes
1
Main Label
Design No
Quality
Select Quality
Super
Picks/Cm
Total Picks
Total Repeat
Wastage
Yes
No
Width
Length
Sq mm
Sq inch
Tab Label
Select Quality
Super
Yes
No
Size Label
Select Quality
Super
Yes
No
Add on
Basic
Cut fold
Diecut
Nonwoven
Iron on back
Extras
Total
Offered
Main
Tab
Size
Add Row
Needle No
Pantone
Color
Shade
Denier
A
B
C
D
E
Action
remove
remove
Front Image
Back Image
All View Image
Design File


Marathon Time Predictor
Select the distance of a race you've recently run: *
5k
10k
10 miles
Half marathon
What was your time for that race? *
Hours:
Minutes:
Seconds:
Select the distance of another race you've recently run:
5k
10k
10 miles
Half marathon
What was your time for that race?
Hours:
Minutes:
Seconds:
Submit


Caring Generations
Welcome {{userName}}
Logout
Connections
Add a connection
{{noConnections}}
{{x.name}}.
Invitations
{{noInvitations}}
You have invited {{i.receiverEmailid}} to connect with you.
You have been invited by {{i.name}}.
Accept
Ignore
Launch Video Recorder:
Click Here


Dropdown with UI elements
- 1. Dropdown should stay open when the mouse goes on the input's autocomplete pane.
- 2. Dropdown should stay open when the mouse reenter in the dropdown from the autocomplete pane.
- 3. Dropdown should close when the nouse leave the dropdown from the autocomplete pane.