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

Does aconfig support short and long versions of fields? #94

Open
ADRFranklin opened this issue Jun 16, 2021 · 4 comments
Open

Does aconfig support short and long versions of fields? #94

ADRFranklin opened this issue Jun 16, 2021 · 4 comments

Comments

@ADRFranklin
Copy link

I'm trying to find out if it's possible that aconfig is able to parse a field that has 2 different uses, a short version (string) and a long version (struct) which provides more detailed version of the overall use.

For example

  dependencies:
    - name: example-plugin
      url: github://someuser/somerepo
      branch: master
      release: v1.0.0

    - name: plugin-repo-without-package-file
      url: gitlab://someuser/somerepo
      branch: dev
      release:
        name: my_plugin_{{.OS}}
        tag: v2.1.3
        type: archive
        path: plugin/plugin

Would I be able to do this, where I can parse it as an interface and then handle extracting it based on it's type?

@cristaloleg
Copy link
Member

Hi, there is no direct support for this. You can try to make it via interface{} as you've mentioned but no idea how it will be :)

@ADRFranklin
Copy link
Author

Ah okay, I have tried to give this ago, and unfortunately it errors out and doesn't like trying to parse an interface. Would there ever be support for this in the future?

@cristaloleg
Copy link
Member

Cannot say for sure. At first it looks like this feature is against current design (everything must be defined in a clear and 1 possible way), from the other side I'm somewhat open for the proposals.

I'm scared that this feature solves small problem and time/pr/review/support will be much higher.

Probably it's easier to change the config to tag and release for this example and forget about minimisation of the config, wdyt? :)

@ADRFranklin
Copy link
Author

Okay, yeah I will give that a go and see how it goes. I was just trying to be convivence for my users. Thanks for responding.

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

No branches or pull requests

2 participants