Skip to content

Commit

Permalink
Merge pull request #244 from mercari/net-url
Browse files Browse the repository at this point in the history
Support URL CEL library
  • Loading branch information
shuheiktgw authored Oct 2, 2024
2 parents e478944 + 38a3d88 commit 04088ed
Show file tree
Hide file tree
Showing 10 changed files with 2,616 additions and 249 deletions.
413 changes: 215 additions & 198 deletions _examples/02_simple/federation/federation.pb.go

Large diffs are not rendered by default.

145 changes: 94 additions & 51 deletions _examples/02_simple/federation/federation_grpc_federation.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions _examples/02_simple/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func TestFederation(t *testing.T) {
if err != nil {
t.Fatal(err)
}

if diff := cmp.Diff(res, &federation.GetPostResponse{
Post: &federation.Post{
Id: "foo",
Expand Down Expand Up @@ -317,6 +318,7 @@ func TestFederation(t *testing.T) {
NullTimestamp3: nil,
JpLoc: "JST",
StringsJoin: "a,b,c",
UrlUserName: "test_user",
}, cmpopts.IgnoreUnexported(
federation.GetPostResponse{},
federation.Post{},
Expand Down
2 changes: 2 additions & 0 deletions _examples/02_simple/proto/federation/federation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ message GetPostResponse {
}
}
def { name: "strings_join" by: "grpc.federation.strings.join(['a', 'b', 'c'], ',')" }
def { name: "url" by: "grpc.federation.url.parse('https://test_user:[email protected]/path')" }
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)" }
Expand Down Expand Up @@ -78,6 +79,7 @@ message GetPostResponse {
google.protobuf.Timestamp null_timestamp3 = 30 [(grpc.federation.field).by = "true ? null : google.protobuf.Timestamp{}"];
string jp_loc = 31 [(grpc.federation.field).by = "jp_time.location().string()"];
string strings_join = 32 [(grpc.federation.field).by = "strings_join"];
string url_user_name = 33 [(grpc.federation.field).by = "url.userinfo().username()"];
}

message A {
Expand Down
Loading

0 comments on commit 04088ed

Please sign in to comment.