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

#1193 Expose constructor of MapInputSource type #1194

Merged
merged 2 commits into from Oct 31, 2020

Conversation

igorrius
Copy link
Contributor

@igorrius igorrius commented Oct 8, 2020

What type of PR is this?

(REQUIRED)

  • bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

Expose constructor of MapInputSource type

Which issue(s) this PR fixes:

v2 feature: Expose constructor of MapInputSource type #1193

Release Notes

This PR exposing the constructor of MapInputSource type. For instance, it possible to extend your type and don't implement all interface features.

type VaultInputSourceContext struct {
	altsrc.MapInputSource
}

func NewVaultInputSourceContext(vaultClient *api.Client, secretRoot string) altsrc.InputSourceContext {
	secret := vaultClient.Logical().Read(secretRoot)
	source := altsrc.NewMapInputSource("vault", secretToMap(secret))
	return &VaultInputSourceContext{*source}
}


@igorrius igorrius requested a review from a team as a code owner October 8, 2020 15:45
@igorrius igorrius requested review from rliebz and asahasrabuddhe and removed request for a team October 8, 2020 15:45
@igorrius
Copy link
Contributor Author

igorrius commented Oct 12, 2020

@rliebz and @asahasrabuddhe, could you please explain how long is the pull request considered?

Copy link
Member

@rliebz rliebz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay here, thanks for your contribution! One minor suggestion on documentation for this, then LGTM.

altsrc/map_input_source.go Outdated Show resolved Hide resolved
Co-authored-by: Robert Liebowitz <rliebz@gmail.com>
@igorrius igorrius requested a review from rliebz October 22, 2020 18:17
Copy link
Member

@asahasrabuddhe asahasrabuddhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay @igorrius

LGTM!

@rliebz rliebz merged commit a99b68f into urfave:master Oct 31, 2020
@igorrius igorrius deleted the extend-altscr branch October 31, 2020 19:38
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.

None yet

3 participants