Skip to content

Commit 68a083f

Browse files
lvan100lianghuan
authored andcommitted
111
1 parent 03e6f3c commit 68a083f

File tree

8 files changed

+199
-215
lines changed

8 files changed

+199
-215
lines changed

gen/testdata/manager/go/manager_http_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func (m *MyManagerServer) Stream(ctx context.Context, req *proto.StreamReq, resp
4545
resp <- &proto.StreamResp{
4646
Id: httputil.Ptr(strconv.Itoa(i)),
4747
Payload: httputil.Ptr(proto.Payload{
48-
FieldType: httputil.Ptr(proto.PayloadTypeAsString(proto.PayloadType_text_data)),
49-
TextData: httputil.Ptr("123"),
48+
FieldType: httputil.Ptr(proto.PayloadTypeAsString(proto.PayloadType_Payload_1)),
49+
Payload1: httputil.Ptr(proto.Payload_1{}),
5050
}),
5151
}
5252
time.Sleep(time.Second)

gen/testdata/manager/go/proto/stream.go

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/testdata/manager/idl/manager.idl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ type ListManagersByPageReq {
141141
// ---- Response types ----
142142

143143
// Create / Update / Get responses
144-
type CreateManagerResp = Response<Manager>
145-
type UpdateManagerResp = Response<Manager>
146-
type GetManagerResp = Response<Manager>
147-
type DeleteManagerResp = Response<bool>
144+
type CreateManagerResp Response<Manager>
145+
type UpdateManagerResp Response<Manager>
146+
type GetManagerResp Response<Manager>
147+
type DeleteManagerResp Response<bool>
148148

149149
// Paginated response
150-
type ManagersPageData = PageResp<Manager>
151-
type ListManagersByPageResp = Response<ManagersPageData>
150+
type ManagersPageData PageResp<Manager>
151+
type ListManagersByPageResp Response<ManagersPageData>
152152

153153
// ---- RPC definitions ----
154154

lib/httpidl/TParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type_def
6565
// Structured type with optional generic parameter
6666
: KW_TYPE IDENTIFIER (LESS_THAN IDENTIFIER GREATER_THAN)? LEFT_BRACE terminator? (type_field terminator)* terminator? RIGHT_BRACE
6767
// Type alias to a generic container
68-
| KW_TYPE IDENTIFIER EQUAL IDENTIFIER LESS_THAN value_type GREATER_THAN
68+
| KW_TYPE IDENTIFIER IDENTIFIER LESS_THAN value_type GREATER_THAN
6969
;
7070

7171
// A type field can be either an embedded type or a named typed field

lib/httpidl/format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func dumpType(t Type) string {
250250
sb.WriteString(t.Name)
251251

252252
if t.Redefined != nil {
253-
sb.WriteString(" = ")
253+
sb.WriteString(" ")
254254
sb.WriteString(t.Redefined.Text())
255255
} else {
256256
// If the type has generic parameter(s)

lib/httpidl/t_parser.go

Lines changed: 187 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/httpidl/testdata/success/http.formated.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ rpc GetUser(UserReq) UserResp {
6464
}
6565

6666
// ---- type re-definition ----
67-
type UserResp = Response<list<User>>
67+
type UserResp Response<list<User>>

lib/httpidl/testdata/success/http.idl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ rpc GetUser (UserReq) UserResp {
6363
}
6464

6565
// ---- type re-definition ----
66-
type UserResp = Response<list<User>>
66+
type UserResp Response<list<User>>

0 commit comments

Comments
 (0)