Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

Commit

Permalink
all: update to new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mpvl committed Feb 10, 2020
1 parent 42fa00d commit ed20e36
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions content/en/docs/about/_index.md
Expand Up @@ -175,7 +175,7 @@ For instance,
could be represented as
```
"a": 3
"b" "c": "foo
"b": "c": "foo
```
All the information of the original JSON file is retained in this
representation.
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs: {
one can write

```
jobs <JobName>: acmeMonitoring
jobs: [string]: acmeMonitoring
jobs: {
foo: { /* ... */ }
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/concepts/logic.md
Expand Up @@ -688,7 +688,7 @@ One can even say on a single line that a collection of
fields must mix in a template.
For instance,
```
jobs <JobName>: acmeMonitoring
jobs: [string]: acmeMonitoring
```
tells CUE that _all_ jobs in `jobs` must mix in `acmeMonitoring`.
There is no need to repeat this at every node.
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/integrations/go.md
Expand Up @@ -65,7 +65,7 @@ all services in our configuration are of type `v1.Service`.
{{< highlight go >}}
import "k8s.io/api/core/v1"

services <Name>: v1.Service
services: [string]: v1.Service
{{< /highlight >}}

You can download definitions from any Go project like this.
Expand Down Expand Up @@ -221,7 +221,7 @@ It does so by lining up the top-level CUE names with Go definitions.
The CUE code can use field tags, similar to those used in Go,
to override the naming.
```go
b, err := Generate("path/to/go/pkg", instance, nil)
b, err := gocode.Generate("path/to/go/pkg", instance, nil)
if err != nil {
// handle error
}
Expand Down
10 changes: 5 additions & 5 deletions content/en/docs/integrations/json.md
Expand Up @@ -62,7 +62,7 @@ The builtin `encoding/json.Marshal` generates JSON from within CUE.
{{< highlight none >}}
import "encoding/json"

configMap data "point.json":
configMap: data: "point.json":
json.Marshal({
x: 4.5
y: 2.34
Expand Down Expand Up @@ -123,11 +123,11 @@ Dimensions :: {
}

// Validate JSON configurations embedded strings.
configs <_>: json.Validate(Dimensions)
configs: [string]: json.Validate(Dimensions)

configs bed: #"{ "width": 2, "height": 0.1, "depth": 2 }"#
configs table: #"{ "width": "34", "height": 23, "depth": 0.2 }"#
configs painting: #"{ "width": 34, "height": 12, "depht": 0.2 }"#
configs: bed: #"{ "width": 2, "height": 0.1, "depth": 2 }"#
configs: table: #"{ "width": "34", "height": 23, "depth": 0.2 }"#
configs: painting: #"{ "width": 34, "height": 12, "depht": 0.2 }"#
{{< /highlight >}}

{{< highlight none >}}
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/integrations/protobuf.md
Expand Up @@ -34,7 +34,7 @@ Adjusted to CUE:
message | struct | Message fields become CUE fields, whereby names are mapped to lowerCamelCase.
enum | e1 | e2 | ... | Where ex are strings. A separate mapping is
| | generated to obtain the numeric values.
map<K, V> | { <>: V } | All keys are converted to strings.
map<K, V> | { [string]: V } | All keys are converted to strings.
repeated V | [...V] | null is accepted as the empty list [].
bool | bool
string | string
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/integrations/yaml.md
Expand Up @@ -90,7 +90,7 @@ import "encoding/yaml"

// Phrases defines a schema for a valid phrase.
Phrases :: {
phrases: { <_>: Phrase }
phrases: [string]: Phrase

Phrase :: {
lang: LanguageTag
Expand Down Expand Up @@ -140,7 +140,7 @@ The builtin `encoding/yaml.Marshal` generates YAML from within CUE.
{{< highlight none >}}
import "encoding/yaml"

configMap data "point.yaml":
configMap: data: "point.yaml":
yaml.Marshal({
x: 4.5
y: 2.34
Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/usecases/configuration.md
Expand Up @@ -58,8 +58,8 @@ spec: Spec
spec: {
knid: "Homo Sapiens" // error, misspelled field
name first: "Jane"
name last: "Doe"
name: first: "Jane"
name: last: "Doe"
}
```

Expand Down

0 comments on commit ed20e36

Please sign in to comment.