Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
encoding/protobuf: remove extra space in comment
Browse files Browse the repository at this point in the history
Change-Id: Ia325389e474003fc20917aea45cfef4a268b4b96
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2940
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Aug 23, 2019
1 parent 28a9191 commit b1d4439
Show file tree
Hide file tree
Showing 16 changed files with 2,116 additions and 2,115 deletions.
8 changes: 4 additions & 4 deletions encoding/protobuf/examples_test.go
Expand Up @@ -42,14 +42,14 @@ func ExampleExtract() {
fmt.Println(string(b))

// Output:
// // Package basic is just that: basic.
// // Package basic is just that: basic.
// package basic
//
// // This is my type.
// // This is my type.
// MyType: {
// stringValue?: string @protobuf(1,name=string_value) // just any 'ole string
// stringValue?: string @protobuf(1,name=string_value) // just any 'ole string
//
// // A method must start with a capital letter.
// // A method must start with a capital letter.
// method?: [...string] @protobuf(2)
// method?: [...=~"^[A-Z]"]
// }
Expand Down
2 changes: 1 addition & 1 deletion encoding/protobuf/protobuf.go
Expand Up @@ -61,7 +61,7 @@
// StringValue string See struct.proto.
// NumberValue number See struct.proto.
// StringValue string See struct.proto.
// Empty struct.MaxFields(0)
// Empty close({})
// Timestamp time.Time See struct.proto.
// Duration time.Duration See struct.proto.
//
Expand Down
124 changes: 62 additions & 62 deletions encoding/protobuf/testdata/attributes.proto.out.cue
@@ -1,17 +1,17 @@

// Copyright 2016 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Copyright 2016 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package v1

import (
Expand All @@ -29,130 +29,130 @@ StructWrap: {
numberVal?: number @protobuf(6,type=google.protobuf.NumberValue)
}

// Attributes represents a set of typed name/value pairs. Many of Mixer's
// API either consume and/or return attributes.
//
// Istio uses attributes to control the runtime behavior of services running in the service mesh.
// Attributes are named and typed pieces of metadata describing ingress and egress traffic and the
// environment this traffic occurs in. An Istio attribute carries a specific piece
// of information such as the error code of an API request, the latency of an API request, or the
// original IP address of a TCP connection. For example:
//
// ```yaml
// request.path: xyz/abc
// request.size: 234
// request.time: 12:34:56.789 04/17/2017
// source.ip: 192.168.0.1
// target.service: example
// ```
//
// Attributes represents a set of typed name/value pairs. Many of Mixer's
// API either consume and/or return attributes.
//
// Istio uses attributes to control the runtime behavior of services running in the service mesh.
// Attributes are named and typed pieces of metadata describing ingress and egress traffic and the
// environment this traffic occurs in. An Istio attribute carries a specific piece
// of information such as the error code of an API request, the latency of an API request, or the
// original IP address of a TCP connection. For example:
//
// ```yaml
// request.path: xyz/abc
// request.size: 234
// request.time: 12:34:56.789 04/17/2017
// source.ip: 192.168.0.1
// target.service: example
// ```
//
Attributes: {
// A map of attribute name to its value.
// A map of attribute name to its value.
attributes: {
<_>: Attributes_AttributeValue
} @protobuf(1,type=map<string,AttributeValue>)
}

// Specifies one attribute value with different type.
// Specifies one attribute value with different type.
Attributes_AttributeValue: {
}
// The attribute value.
// The attribute value.
Attributes_AttributeValue: {
// Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI
// Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI
stringValue: string @protobuf(2,name=string_value)
} | {
// Used for values of type INT64
// Used for values of type INT64
int64Value: int64 @protobuf(3,name=int64_value)
} | {
// Used for values of type DOUBLE
// Used for values of type DOUBLE
doubleValue: float64 @protobuf(4,type=double,name=double_value)
} | {
// Used for values of type BOOL
// Used for values of type BOOL
boolValue: bool @protobuf(5,name=bool_value)
} | {
// Used for values of type BYTES
// Used for values of type BYTES
bytesValue: bytes @protobuf(6,name=bytes_value)
} | {
// Used for values of type TIMESTAMP
// Used for values of type TIMESTAMP
timestampValue: time.Time @protobuf(7,type=google.protobuf.Timestamp,name=timestamp_value)
} | {
// Used for values of type DURATION
// Used for values of type DURATION
durationValue: time.Duration @protobuf(8,type=google.protobuf.Duration,name=duration_value)
} | {
// Used for values of type STRING_MAP
// Used for values of type STRING_MAP
stringMapValue: Attributes_StringMap @protobuf(9,type=StringMap,name=string_map_value)
} | {
testValue: test.Test @protobuf(10,type=acme.test.Test,name=test_value)
} | {
testValue: test_test.AnotherTest @protobuf(11,type=acme.test.test.AnotherTest,name=test_value)
}

// Defines a string map.
// Defines a string map.
Attributes_StringMap: {
// Holds a set of name/value pairs.
// Holds a set of name/value pairs.
entries: {
<_>: string
} @protobuf(1,type=map<string,string>)
}

// Defines a list of attributes in compressed format optimized for transport.
// Within this message, strings are referenced using integer indices into
// one of two string dictionaries. Positive integers index into the global
// deployment-wide dictionary, whereas negative integers index into the message-level
// dictionary instead. The message-level dictionary is carried by the
// `words` field of this message, the deployment-wide dictionary is determined via
// configuration.
// Defines a list of attributes in compressed format optimized for transport.
// Within this message, strings are referenced using integer indices into
// one of two string dictionaries. Positive integers index into the global
// deployment-wide dictionary, whereas negative integers index into the message-level
// dictionary instead. The message-level dictionary is carried by the
// `words` field of this message, the deployment-wide dictionary is determined via
// configuration.
CompressedAttributes: {
// The message-level dictionary.
// The message-level dictionary.
words?: [...string] @protobuf(1)

// Holds attributes of type STRING, DNS_NAME, EMAIL_ADDRESS, URI
// Holds attributes of type STRING, DNS_NAME, EMAIL_ADDRESS, URI
strings: {
<_>: int32
} @protobuf(2,type=map<sint32,sint32>)

// Holds attributes of type INT64
// Holds attributes of type INT64
int64s: {
<_>: int64
} @protobuf(3,type=map<sint32,int64>)

// Holds attributes of type DOUBLE
// Holds attributes of type DOUBLE
doubles: {
<_>: float64
} @protobuf(4,type=map<sint32,double>)

// Holds attributes of type BOOL
// Holds attributes of type BOOL
bools: {
<_>: bool
} @protobuf(5,type=map<sint32,bool>)

// Holds attributes of type TIMESTAMP
// Holds attributes of type TIMESTAMP
time: {
<_>: __time.Time
} @protobuf(6,type=map<sint32,google.protobuf.Timestamp>,"(gogoproto.nullable)=false","(gogoproto.stdtime)")

// Holds attributes of type DURATION
// Holds attributes of type DURATION
durations: {
<_>: __time.Duration
} @protobuf(7,type=map<sint32,google.protobuf.Duration>,"(gogoproto.nullable)=false","(gogoproto.stdduration)")

// Holds attributes of type BYTES
// Holds attributes of type BYTES
bytes: {
<_>: __bytes
} @protobuf(8,type=map<sint32,bytes>)

// Holds attributes of type STRING_MAP
// Holds attributes of type STRING_MAP
stringMaps: {
<_>: StringMap
} @protobuf(9,type=map<sint32,StringMap>,string_maps,"(gogoproto.nullable)=false")
}
__time = time
__bytes = bytes

// A map of string to string. The keys and values in this map are dictionary
// indices (see the [Attributes][istio.mixer.v1.CompressedAttributes] message for an explanation)
// A map of string to string. The keys and values in this map are dictionary
// indices (see the [Attributes][istio.mixer.v1.CompressedAttributes] message for an explanation)
StringMap: {
// Holds a set of name/value pairs.
// Holds a set of name/value pairs.
entries: {
<_>: int32
} @protobuf(1,type=map<sint32,sint32>)
Expand Down

0 comments on commit b1d4439

Please sign in to comment.