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 'exclusive' interfaces #674

Merged
merged 4 commits into from
Mar 10, 2025
Merged

Support 'exclusive' interfaces #674

merged 4 commits into from
Mar 10, 2025

Conversation

emdoyle
Copy link
Member

@emdoyle emdoyle commented Mar 10, 2025

Now that interfaces can be 'split' using visibility, it is useful to be able to say that a given interface is the 'exclusive' way that a module is allowed to be used by another module.

For example, consider the following config within a tach.domain.toml:

[[modules]]
path = "api"
depends_on = ["**"]
visibility = ["<domain_root>", "//module5"]
layer = "mid"

[[interfaces]]
expose = ["something"]
from = ["api"]

[[interfaces]]
expose = ["MyAPI"]
from = ["api"]
visibility = ["//module5"]
exclusive = true

Given the configuration above, the 'default' interface exposed by api is api.something.
However, module5 may only use api.MyAPI.

Before this PR, and without the exclusive flag, this would not have been possible. In that case, module5 would have been allowed to use both api.something and api.MyAPI.

Base automatically changed from interface-visibility to main March 10, 2025 22:53
@emdoyle emdoyle marked this pull request as ready for review March 10, 2025 22:53
@emdoyle emdoyle merged commit d285de0 into main Mar 10, 2025
8 of 11 checks passed
@emdoyle emdoyle deleted the exclusive-interfaces branch March 10, 2025 22:57
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.

1 participant