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 urfave/cli as a code owner Oct 8, 2020
@igorrius igorrius requested review from rliebz and asahasrabuddhe and removed request for urfave/cli Oct 8, 2020
@igorrius
Copy link
Contributor Author

@igorrius 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

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 Oct 22, 2020
Copy link
Member

@asahasrabuddhe asahasrabuddhe left a comment

Sorry for the delay @igorrius

LGTM!

@rliebz
rliebz approved these changes Oct 31, 2020
@rliebz rliebz merged commit a99b68f into urfave:master Oct 31, 2020
12 checks passed
12 checks passed
ubuntu-latest @ Go 1.12 ubuntu-latest @ Go 1.12
Details
ubuntu-latest @ Go 1.13 ubuntu-latest @ Go 1.13
Details
ubuntu-latest @ Go 1.14 ubuntu-latest @ Go 1.14
Details
macos-latest @ Go 1.12 macos-latest @ Go 1.12
Details
macos-latest @ Go 1.13 macos-latest @ Go 1.13
Details
macos-latest @ Go 1.14 macos-latest @ Go 1.14
Details
windows-latest @ Go 1.12 windows-latest @ Go 1.12
Details
windows-latest @ Go 1.13 windows-latest @ Go 1.13
Details
windows-latest @ Go 1.14 windows-latest @ Go 1.14
Details
test-docs test-docs
Details
codecov/patch 100.00% of diff hit (target 71.57%)
Details
codecov/project 71.62% (+0.05%) compared to cd82784
Details
@igorrius igorrius deleted the igorrius:extend-altscr branch Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants