platform: add GetMailRelay - #2
Merged
Merged
Conversation
Apps need the mail relay endpoint and credentials the platform serves on the app api socket. The response carries an object rather than a string, so it gets its own typed response instead of reusing Response.
This was referenced Jul 29, 2026
An app built against this library has to keep working on a platform that predates the mail relay, where the endpoint does not exist. A 404 means the feature is unavailable, not that the call failed, so report it as disabled rather than an error that would fail an install hook.
One struct per file named after it, and GetMailRelay alongside the other Client methods rather than in a file of its own.
Without a trigger the pipeline ran for both push and pull_request, so every commit produced two identical builds. Branches live in this repo, so push still covers pull request commits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Client method for the Syncloud mail relay, so apps can read the relay endpoint and credentials the platform serves on the app api socket.
3 of 4 PRs: platform · golib (this) · mail · redirect.
Changes
Client.GetMailRelay()→GET http://unix/mail/relay, returning{enabled, host, port, login, password}.MailRelayResponseinstead of reusing the sharedResponse, whoseDatais astring.Credentials are the device's existing domain update token and device domain — the same pair the frp traffic relay uses — so this call provisions and stores nothing.
Verification
go build ./...andgofmtclean;go test ./platform/...passes, including tests for the enabled, disabled and missing-endpoint responses.Requires syncloud/platform#761 for the endpoint to exist. The mail app currently depends on this branch by commit and moves to a tagged release once this merges.