-
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.
Signed-off-by: jkoberg <jkoberg@owncloud.com>
- Loading branch information
Showing
18 changed files
with
208 additions
and
47 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Enhancement: Eventhistory service | ||
|
||
Introduces the `eventhistory` service. It is a service that is storing events and providing a grpc API to retrieve them | ||
Introduces the `eventhistory` service. It is a service that stores events and provides a grpc API to retrieve them. | ||
|
||
https://github.com/owncloud/ocis/pull/5600 |
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,50 @@ | ||
package store | ||
|
||
import "time" | ||
|
||
// Option provides an option to configure the store | ||
type Option func(*Options) | ||
|
||
// Type defines the type of the store | ||
func Type(typ string) Option { | ||
return func(o *Options) { | ||
o.Type = typ | ||
} | ||
} | ||
|
||
// Addresses defines the addresses where the store can be reached | ||
func Addresses(addrs ...string) Option { | ||
return func(o *Options) { | ||
o.Addresses = addrs | ||
} | ||
} | ||
|
||
// Database defines the Database the store should use | ||
func Database(db string) Option { | ||
return func(o *Options) { | ||
o.Database = db | ||
} | ||
} | ||
|
||
// Table defines the table the store should use | ||
func Table(t string) Option { | ||
return func(o *Options) { | ||
o.Table = t | ||
} | ||
} | ||
|
||
// Size defines the maximum capacity of the store. | ||
// Only applicable when using "ocmem" store | ||
func Size(s int) Option { | ||
return func(o *Options) { | ||
o.Size = s | ||
} | ||
} | ||
|
||
// TTL defines the time to life for elements in the store. | ||
// Only applicable when using "natsjs" store | ||
func TTL(t time.Duration) Option { | ||
return func(o *Options) { | ||
o.TTL = t | ||
} | ||
} |
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,15 +1,27 @@ | ||
# Eventhistory service | ||
# Eventhistory Service | ||
|
||
The `eventhistory` consumes all events from the configured event systems, stores them and allows to retrieve them via an eventid | ||
The `eventhistory` consumes all events from the configured event system like NATS, stores them and allows to retrieve them via an eventid. | ||
|
||
## Prerequisites | ||
|
||
Running the eventhistory service without an event sytem like NATS is not possible. | ||
|
||
## Consuming | ||
|
||
The `eventhistory` services consumes all events from the configured event sytem. Running it without an event sytem is not possible. | ||
The `eventhistory` services consumes all events from the configured event sytem. | ||
|
||
## Storing | ||
|
||
The `eventhistory` stores each consumed event in the configured store. Possible stores are ? and ? but not ?. | ||
The `eventhistory` stores each consumed event in the configured store. Possible stores are: | ||
- `mem`: Basic inmemory store and the default. Does not support expiry. | ||
- `ocmem`: Advanced inmemory store allowing max size. Does not support expiry. | ||
- `redis`: Stores data in a configured redis cluster. | ||
- `etcd`: Stores data in a configured etcd cluster. | ||
- `nats-js`: Stores data using nats. | ||
- `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments. | ||
|
||
Events stay in the store for 2 weeks by default (if expiry is supported, see store details). Use `EVENTHISTORY_RECORD_EXPIRY` to adjust this value. | ||
|
||
## Retrieving | ||
|
||
Other services can call the `eventhistory` service via a grpc call to retrieve events. The request must contain the eventid that should be retrieved | ||
Other services can call the `eventhistory` service via a grpc call to retrieve events. The request must contain the eventid that should be retrieved. |
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
Oops, something went wrong.