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

fix: fix broken FTL examples #872

Merged
merged 2 commits into from
Feb 3, 2024
Merged

fix: fix broken FTL examples #872

merged 2 commits into from
Feb 3, 2024

Conversation

wesbillman
Copy link
Collaborator

@wesbillman wesbillman commented Feb 2, 2024

No description provided.

func Echo(ctx context.Context, req EchoRequest) (EchoResponse, error) {
fmt.Println("Echo received a request!")
tresp, err := sdk.Call(ctx, time.Time, time.TimeRequest{})
if err != nil {
return EchoResponse{}, err
}
return EchoResponse{Message: fmt.Sprintf("Hello, %s!!! It is %s!", req.Name.Default("anonymous"), tresp.Time)}, nil
return EchoResponse{Message: fmt.Sprintf("Hello, %s!!! It is %s!", req.Name.Default("anonymous"), tresp)}, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

return when {
req.contextKeys != null -> AdResponse(ads = contextualAds(req.contextKeys))
else -> AdResponse(ads = randomAds())
@Ingress(Method.GET, "/get", HTTP)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, we should get rid of HTTP and call this @HttpIngress. It's not going to be usable for any other type such as gRPC anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good call. I'll make a ticket to clean this up.
#874

@wesbillman wesbillman marked this pull request as ready for review February 3, 2024 17:25
@wesbillman wesbillman merged commit 80e2420 into main Feb 3, 2024
11 checks passed
@wesbillman wesbillman deleted the fix-examples branch February 3, 2024 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants