-
Notifications
You must be signed in to change notification settings - Fork 4
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
chore: upgrade to latest go-libs #59
Merged
antoinegelloz
merged 2 commits into
main
from
feat/num-1050-payments-update-go-libs-to-last-version
Nov 29, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
exclude: client | ||
fail_fast: true | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
exclude: .cloud | ||
- id: check-added-large-files | ||
- repo: https://github.com/formancehq/pre-commit-hooks | ||
rev: dd079f7c30ad72446d615f55a000d4f875e79633 | ||
hooks: | ||
- id: gogenerate | ||
files: swagger.yaml | ||
- id: gomodtidy | ||
- id: goimports | ||
- id: gofmt | ||
- id: golangci-lint | ||
- id: gotests | ||
- id: commitlint |
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 |
---|---|---|
|
@@ -9,4 +9,3 @@ lint-fix: | |
|
||
run-tests: | ||
go test -race -count=1 ./... | ||
|
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ import ( | |
"strings" | ||
|
||
_ "github.com/bombsimon/logrusr/v3" | ||
"github.com/formancehq/go-libs/sharedotlp/pkg/sharedotlptraces" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/viper" | ||
) | ||
|
@@ -37,46 +38,33 @@ func rootCommand() *cobra.Command { | |
root.AddCommand(server) | ||
|
||
root.PersistentFlags().Bool(debugFlag, false, "Debug mode") | ||
root.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
root.Flags().Bool(debugFlag, false, "Debug mode") | ||
root.Flags().String(mongodbURIFlag, "mongodb://localhost:27017", "MongoDB address") | ||
root.Flags().String(mongodbDatabaseFlag, "payments", "MongoDB database name") | ||
root.Flags().Bool(otelTracesFlag, false, "Enable OpenTelemetry traces support") | ||
root.Flags().String(otelTracesExporterFlag, "stdout", "OpenTelemetry traces exporter") | ||
root.Flags().String(otelTracesExporterJaegerEndpointFlag, | ||
"", "OpenTelemetry traces Jaeger exporter endpoint") | ||
root.Flags().String(otelTracesExporterJaegerUserFlag, | ||
"", "OpenTelemetry traces Jaeger exporter user") | ||
root.Flags().String(otelTracesExporterJaegerPasswordFlag, | ||
"", "OpenTelemetry traces Jaeger exporter password") | ||
root.Flags().String(otelTracesExporterOTLPModeFlag, | ||
"grpc", "OpenTelemetry traces OTLP exporter mode (grpc|http)") | ||
root.Flags().String(otelTracesExporterOTLPEndpointFlag, | ||
"", "OpenTelemetry traces grpc endpoint") | ||
root.Flags().Bool(otelTracesExporterOTLPInsecureFlag, | ||
false, "OpenTelemetry traces grpc insecure") | ||
root.Flags().String(envFlag, "local", "Environment") | ||
root.Flags().Bool(publisherKafkaEnabledFlag, false, "Publish write events to kafka") | ||
root.Flags().StringSlice(publisherKafkaBrokerFlag, []string{}, "Kafka address is kafka enabled") | ||
root.Flags().StringSlice(publisherTopicMappingFlag, | ||
server.Flags().BoolP("toggle", "t", false, "Help message for toggle") | ||
server.Flags().String(mongodbURIFlag, "mongodb://localhost:27017", "MongoDB address") | ||
server.Flags().String(mongodbDatabaseFlag, "payments", "MongoDB database name") | ||
server.Flags().String(envFlag, "local", "Environment") | ||
server.Flags().Bool(publisherKafkaEnabledFlag, false, "Publish write events to kafka") | ||
server.Flags().StringSlice(publisherKafkaBrokerFlag, []string{}, "Kafka address is kafka enabled") | ||
server.Flags().StringSlice(publisherTopicMappingFlag, | ||
[]string{}, "Define mapping between internal event types and topics") | ||
root.Flags().Bool(publisherHTTPEnabledFlag, false, "Sent write event to http endpoint") | ||
root.Flags().Bool(publisherKafkaSASLEnabled, false, "Enable SASL authentication on kafka publisher") | ||
root.Flags().String(publisherKafkaSASLUsername, "", "SASL username") | ||
root.Flags().String(publisherKafkaSASLPassword, "", "SASL password") | ||
root.Flags().String(publisherKafkaSASLMechanism, "", "SASL authentication mechanism") | ||
root.Flags().Int(publisherKafkaSASLScramSHASize, 512, "SASL SCRAM SHA size") | ||
root.Flags().Bool(publisherKafkaTLSEnabled, false, "Enable TLS to connect on kafka") | ||
root.Flags().Bool(authBasicEnabledFlag, false, "Enable basic auth") | ||
root.Flags().StringSlice(authBasicCredentialsFlag, []string{}, | ||
server.Flags().Bool(publisherHTTPEnabledFlag, false, "Sent write event to http endpoint") | ||
server.Flags().Bool(publisherKafkaSASLEnabled, false, "Enable SASL authentication on kafka publisher") | ||
server.Flags().String(publisherKafkaSASLUsername, "", "SASL username") | ||
server.Flags().String(publisherKafkaSASLPassword, "", "SASL password") | ||
server.Flags().String(publisherKafkaSASLMechanism, "", "SASL authentication mechanism") | ||
server.Flags().Int(publisherKafkaSASLScramSHASize, 512, "SASL SCRAM SHA size") | ||
server.Flags().Bool(publisherKafkaTLSEnabled, false, "Enable TLS to connect on kafka") | ||
server.Flags().Bool(authBasicEnabledFlag, false, "Enable basic auth") | ||
server.Flags().StringSlice(authBasicCredentialsFlag, []string{}, | ||
"HTTP basic auth credentials (<username>:<password>)") | ||
root.Flags().Bool(authBearerEnabledFlag, false, "Enable bearer auth") | ||
root.Flags().String(authBearerIntrospectURLFlag, "", "OAuth2 introspect URL") | ||
root.Flags().StringSlice(authBearerAudienceFlag, []string{}, "Allowed audiences") | ||
root.Flags().Bool(authBearerAudiencesWildcardFlag, false, "Don't check audience") | ||
root.Flags().Bool(authBearerUseScopesFlag, | ||
server.Flags().Bool(authBearerEnabledFlag, false, "Enable bearer auth") | ||
server.Flags().String(authBearerIntrospectURLFlag, "", "OAuth2 introspect URL") | ||
server.Flags().StringSlice(authBearerAudienceFlag, []string{}, "Allowed audiences") | ||
server.Flags().Bool(authBearerAudiencesWildcardFlag, false, "Don't check audience") | ||
server.Flags().Bool(authBearerUseScopesFlag, | ||
false, "Use scopes as defined by rfc https://datatracker.ietf.org/doc/html/rfc8693") | ||
|
||
sharedotlptraces.InitOTLPTracesFlags(server.Flags()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Library now automatically setup flags. |
||
|
||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) | ||
viper.AutomaticEnv() | ||
|
||
|
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,5 @@ | ||
module.exports = { | ||
extends: [ | ||
'@commitlint/config-conventional' | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set flags on server command and not un root command.