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

Redesign MimeType #306

Open
whyoleg opened this issue Mar 11, 2025 · 0 comments
Open

Redesign MimeType #306

whyoleg opened this issue Mar 11, 2025 · 0 comments

Comments

@whyoleg
Copy link
Member

whyoleg commented Mar 11, 2025

Main changes:

  • rename to RSocketMimeType
  • move to root package
  • use nested classes

POC API:

public sealed interface RSocketMimeType {
    public sealed interface WithName : RSocketMimeType {
        public val name: String
    }

    public sealed interface WithIdentifier : RSocketMimeType {
        public val identifier: Byte
    }

    public sealed interface WellKnown : WithIdentifier, WithName

    public companion object {
        public val ApplicationAvro: WellKnown
        public val ApplicationCbor: WellKnown
    }
}

public fun RSocketMimeType(name: String): RSocketMimeType.WithName
public fun RSocketMimeType(identifier: Byte): RSocketMimeType.WithIdentifier

Similar API design should be done to auth and metadata types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant