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

docs: move language-specific visibility docs into respective tabs #2950

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions docs/content/docs/reference/visibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ Exporting a declaration makes it accessible to other modules. Some declarations

Types that are transitively referenced by an exported declaration will be automatically exported unless they were already defined but unexported. In this case, an error will be raised and the type must be explicitly exported.


{% code_selector() %}

<!-- go -->

The following table describes the go directives used to export the corresponding declaration:

| Symbol | Export syntax |
Expand All @@ -30,30 +35,31 @@ The following table describes the go directives used to export the corresponding
| Enum/Sum type | `//ftl:enum export` |
| Typealias | `//ftl:typealias export` |
| Topic | `//ftl:export` [^1] |

For JVM languages the `@Export` annotation can be used to export a declaration.

eg.

{% code_selector() %}

<!-- go -->
```go
//ftl:verb export
func Verb(ctx context.Context, in In) (Out, error)

//ftl:typealias export
type UserID string
```

[^1]: By default, topics do not require any annotations as the declaration itself is sufficient.

<!-- kotlin -->
```kotlin

For Kotlin the `@Export` annotation can be used to export a declaration:

```kotlin
@Verb
@Export
fun time(): TimeResponse {
// ...
}
```
<!-- java -->

For Java the `@Export` annotation can be used to export a declaration:

```java
@Verb
@Export
Expand All @@ -62,5 +68,3 @@ TimeResponse time() {
}
```
{% end %}

[^1]: By default, topics do not require any annotations as the declaration itself is sufficient.
Loading