-
Notifications
You must be signed in to change notification settings - Fork 184
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 #3192 from owncloud/nats-check-for-error
[full-ci] use NATS JetStream
- Loading branch information
Showing
13 changed files
with
93 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Change: Switch NATS backend | ||
|
||
We've switched the NATS backend from Streaming to JetStream, since NATS Streaming is depreciated. | ||
|
||
https://github.com/owncloud/ocis/pull/3192 | ||
https://github.com/cs3org/reva/pull/2574 |
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 |
---|---|---|
@@ -1,31 +1,36 @@ | ||
package nats | ||
|
||
import ( | ||
natsServer "github.com/nats-io/nats-server/v2/server" | ||
"github.com/nats-io/nats-streaming-server/logger" | ||
stanServer "github.com/nats-io/nats-streaming-server/server" | ||
nserver "github.com/nats-io/nats-server/v2/server" | ||
) | ||
|
||
// Option configures the nats server | ||
type Option func(*natsServer.Options, *stanServer.Options) | ||
// NatsOption configures the nats server | ||
type NatsOption func(*nserver.Options) | ||
|
||
// Host sets the host URL for the nats server | ||
func Host(url string) Option { | ||
return func(no *natsServer.Options, _ *stanServer.Options) { | ||
no.Host = url | ||
func Host(url string) NatsOption { | ||
return func(o *nserver.Options) { | ||
o.Host = url | ||
} | ||
} | ||
|
||
// Port sets the host URL for the nats server | ||
func Port(port int) Option { | ||
return func(no *natsServer.Options, _ *stanServer.Options) { | ||
no.Port = port | ||
func Port(port int) NatsOption { | ||
return func(o *nserver.Options) { | ||
o.Port = port | ||
} | ||
} | ||
|
||
// Port sets the host URL for the nats server | ||
func Logger(logger logger.Logger) Option { | ||
return func(no *natsServer.Options, so *stanServer.Options) { | ||
so.CustomLogger = logger | ||
// ClusterID sets the name for the nats cluster | ||
func ClusterID(clusterID string) NatsOption { | ||
return func(o *nserver.Options) { | ||
o.Cluster.Name = clusterID | ||
} | ||
} | ||
|
||
// StoreDir sets the folder for persistence | ||
func StoreDir(StoreDir string) NatsOption { | ||
return func(o *nserver.Options) { | ||
o.StoreDir = StoreDir | ||
} | ||
} |
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