Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add trailing commas to Starlark code #218

Merged
merged 5 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/docs/reference/starlark-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ all_services = plan.add_services(
configs = {
"example-datastore-server-1": datastore_server_config_1,
"example-datastore-server-2": datastore_server_config_2,
}
},
)
```

Expand Down Expand Up @@ -398,7 +398,7 @@ The instruction returns a response, which is a `dict` with following key-value p
post_request_recipe = PostHttpRequestRecipe(
...
extract = {
"second-element-from-list-head": '.result.foo | .[0] | split ("/") | .[1]' #
"second-element-from-list-head": '.result.foo | .[0] | split ("/") | .[1]',
},
)
response = plan.request(
Expand Down Expand Up @@ -469,13 +469,13 @@ Say we are overriding a connection between two subnetworks, as shown below:

connection_config = ConnectionConfig(
packet_delay_distribution = UniformPacketDelayDistribution(
ms = 500
)
ms = 500,
),
)

set_connection(
subnetworks = ("subnetworkA", "subnetworkB"),
config = connection_config
config = connection_config,
)

```
Expand Down
32 changes: 16 additions & 16 deletions docs/docs/reference/starlark-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ connection_config = ConnectionConfig(
# OPTIONAL: Valid value are UniformPacketDelayDistribution or NormalPacketDelayDistribution
packet_delay_distribution = UniformPacketDelayDistribution(
# Delay in ms
ms = 500
)
ms = 500,
),
)
```

Expand Down Expand Up @@ -84,8 +84,8 @@ get_request_recipe = GetHttpRequestRecipe(
# To lean more about jq, please visit https://devdocs.io/jq/
# OPTIONAL
extract = {
"extractfield" : ".name.id"
}
"extractfield" : ".name.id",
},
)
```

Expand All @@ -97,9 +97,9 @@ Important - `port_id` field accepts user defined ID assinged to a port in servic
ports = {
// "port_id": port_number
"http": 5000,
"grpc": 3000
"grpc": 3000,
...
}
},
...
)
```
Expand All @@ -110,7 +110,7 @@ The user defined port IDs in above port map are: `http` and `grpc`. These can be
recipe = GetHttpRequestRecipe(
port_id = "http",
service_name = "service-using-test-service-config",
endpoint = "/ping"
endpoint = "/ping",
...
)
```
Expand Down Expand Up @@ -153,8 +153,8 @@ post_request_recipe = PostHttpRequestRecipe(
# # To lean more about jq, please visit https://devdocs.io/jq/
# OPTIONAL
extract = {
"extractfield" : ".name.id"
}
"extractfield" : ".name.id",
},
)
```

Expand All @@ -178,7 +178,7 @@ delay = UniformPacketDelayDistribution(
# Non-Negative Integer
# Amount of constant delay added to outgoing packets from the subnetwork
# MANDATORY
ms = 1000
ms = 1000,
)
```

Expand All @@ -192,19 +192,19 @@ delay = NormalPacketDelayDistribution(
# Non-Negative Integer
# Amount of mean delay added to outgoing packets from the subnetwork
# MANDATORY
mean_ms = 1000
mean_ms = 1000,

# Non-Negative Integer
# Amount of variance (jitter) added to outgoing packets from the subnetwork
# MANDATORY
std_dev_ms = 10
std_dev_ms = 10,

# Non-Negative Float
# Percentage of correlation observed among packets. It means that the delay observed in next packet
# will exhibit a corrlation factor of 10.0% with the previous packet.
# OPTIONAL
# DEFAULT = 0.0
correlation = 10.0
correlation = 10.0,
)
```

Expand All @@ -224,7 +224,7 @@ port_spec = PortSpec(

# Application protocol for the port
# Optional
application_protocol = "http"
application_protocol = "http",
)
```
The above constructor returns a `PortSpec` object that contains port information in the form of a [future reference][future-references-reference] and can be used with
Expand Down Expand Up @@ -255,7 +255,7 @@ config = ServiceConfig(

# Application protocol for the port
# Optional
application_protocol = "http"
application_protocol = "http",
),
},

Expand Down Expand Up @@ -324,7 +324,7 @@ update_service_config = UpdateServiceConfig(
# The subnetwork to which the service will be moved.
# "default" can be used to move the service to the default subnetwork
# MANDATORY
subnetwork = "subnetwork_1"
subnetwork = "subnetwork_1",
)
```

Expand Down