mirror of
https://github.com/versity/versitygw.git
synced 2026-09-01 13:46:55 +00:00
feat: Set up bucket event notifications with nats
This commit is contained in:
committed by
Ben McClelland
parent
6f0f527e5f
commit
7bceaaca39
@@ -38,6 +38,7 @@ var (
|
||||
region string
|
||||
certFile, keyFile string
|
||||
kafkaURL, kafkaTopic, kafkaKey string
|
||||
natsURL, natsTopic string
|
||||
logWebhookURL string
|
||||
accessLog bool
|
||||
debug bool
|
||||
@@ -174,6 +175,18 @@ func initFlags() []cli.Flag {
|
||||
Destination: &kafkaKey,
|
||||
Aliases: []string{"ekk"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "event-nats-url",
|
||||
Usage: "nats server url to send the bucket notifications",
|
||||
Destination: &natsURL,
|
||||
Aliases: []string{"enu"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "event-nats-topic",
|
||||
Usage: "nats server pub-sub topic to send the bucket notifications to",
|
||||
Destination: &natsTopic,
|
||||
Aliases: []string{"ent"},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +240,8 @@ func runGateway(ctx *cli.Context, be backend.Backend, s auth.Storer) error {
|
||||
KafkaURL: kafkaURL,
|
||||
KafkaTopic: kafkaTopic,
|
||||
KafkaTopicKey: kafkaKey,
|
||||
NatsURL: natsURL,
|
||||
NatsTopic: natsTopic,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to connect to the message broker: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user