generated from dogmatiq/template-go
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from dogmatiq/see-also
See also
- Loading branch information
Showing
104 changed files
with
1,505 additions
and
1,073 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ferrite | ||
|
||
import "github.com/dogmatiq/ferrite/variable" | ||
|
||
// An Input is the application-facing interface for obtaining a value from | ||
// environment variables. | ||
// | ||
// Typically each input is sourced from exactly one environment variable, | ||
// however it is possible that a value collates values from multiple variables. | ||
// | ||
// An input is created using one of the various builder-functions, for example | ||
// String(). | ||
type Input interface { | ||
variables() []variable.Any | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package markdown_test | ||
|
||
import ( | ||
"github.com/dogmatiq/ferrite" | ||
"github.com/dogmatiq/ferrite/variable" | ||
. "github.com/onsi/ginkgo/v2" | ||
) | ||
|
||
var _ = DescribeTable( | ||
"func Run()", | ||
tableTest("complete"), | ||
Entry( | ||
"no variables", | ||
"empty.md", | ||
func(reg *variable.Registry) {}, | ||
), | ||
Entry( | ||
"non-normative examples", | ||
"non-normative.md", | ||
func(reg *variable.Registry) { | ||
ferrite. | ||
String("READ_DSN", "database connection string for read-models"). | ||
Required(variable.WithRegistry(reg)) | ||
}, | ||
), | ||
Entry( | ||
"platform examples", | ||
"platform-examples.md", | ||
func(reg *variable.Registry) { | ||
ferrite. | ||
Bool("DEBUG", "enable or disable debugging features"). | ||
Optional(variable.WithRegistry(reg)) | ||
}, | ||
), | ||
Entry( | ||
"platform examples use default values as examples when available", | ||
"platform-examples-use-defaults.md", | ||
func(reg *variable.Registry) { | ||
ferrite. | ||
NetworkPort("PORT", "an environment variable that has a default value"). | ||
WithDefault("ftp"). | ||
Required(variable.WithRegistry(reg)) | ||
}, | ||
), | ||
Entry( | ||
"see also", | ||
"see-also.md", | ||
func(reg *variable.Registry) { | ||
verbose := ferrite. | ||
Bool("VERBOSE", "enable verbose logging"). | ||
Optional(variable.WithRegistry(reg)) | ||
|
||
ferrite. | ||
Bool("DEBUG", "enable or disable debugging features"). | ||
SeeAlso(verbose). | ||
Optional(variable.WithRegistry(reg)) | ||
}, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.