Skip to content

Commit

Permalink
Merge pull request #81 from mercari/fix-std-cel-lib
Browse files Browse the repository at this point in the history
Fix type conversion for Standard CEL library types
  • Loading branch information
goccy authored Dec 12, 2023
2 parents e5f082a + e849e66 commit f605c26
Show file tree
Hide file tree
Showing 18 changed files with 634 additions and 272 deletions.
257 changes: 149 additions & 108 deletions _examples/02_simple/federation/federation.pb.go

Large diffs are not rendered by default.

277 changes: 238 additions & 39 deletions _examples/02_simple/federation/federation_grpc_federation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion _examples/02_simple/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func TestFederation(t *testing.T) {
},
},
},
Str: "hello",
Str: "hello",
Uuid: "daa4728d-159f-4fc2-82cf-cae915d54e08",
Loc: "Asia/Tokyo",
}, cmpopts.IgnoreUnexported(
federation.GetPostResponse{},
federation.Post{},
Expand Down
7 changes: 7 additions & 0 deletions _examples/02_simple/proto/federation/federation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ message GetPostResponse {
args { name: "id", by: "$.id" }
}
}
def { name: "date" by: "grpc.federation.time.date(2023, 12, 25, 12, 10, 5, 0, grpc.federation.time.UTC())" }
def { name: "rand_source" by: "grpc.federation.rand.newSource(date.unix())" }
def { name: "fixed_rand" by: "grpc.federation.rand.new(rand_source)" }
def { name: "uuid" by: ".grpc.federation.uuid.newRandomFromRand(fixed_rand)" }
def { name: "loc" by: "grpc.federation.time.loadLocation('Asia/Tokyo')"}
};
Post post = 1 [(grpc.federation.field).by = "post"];
string str = 2 [(grpc.federation.field).string = "hello"];
string uuid = 3 [(grpc.federation.field).by = "uuid.string()"];
string loc = 4 [(grpc.federation.field).by = "loc.string()"];
}

message Post {
Expand Down
Loading

0 comments on commit f605c26

Please sign in to comment.