Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support URL CEL library #244

Merged
merged 12 commits into from
Oct 2, 2024
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
Loading