Skip to content

Pluggable parsing mechanism #665

@FiloSottile

Description

@FiloSottile

In #580 we discussed how many applications, including the CLI itself, end up having to reimplement ParseRecipients and ParseIdentities to expand the set of accepted types. This is going to become even more of a thing now that filippo.io/age/tag is a thing.

We should probably figure out some pluggable mechanism.

#518 suggests adding an error that ParseRecipient/Identity functions can return to disown the encoding and let the caller try a different type. That might be part of the solution.

filippo.io/age/cmd.identitiesToRecipients has a similar issue, which might be solvable similarly, or might be solvable with reflection (all identities have a Recipient method that returns a type that implements the Recipient interface). Or maybe it doesn't matter as much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions