-
Notifications
You must be signed in to change notification settings - Fork 187
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 <[email protected]>
- Loading branch information
Showing
20 changed files
with
309 additions
and
48 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,28 @@ | ||
# 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` service stores each consumed event via the configured store in `EVENTHISTORY_STORE_TYPE`. Possible stores are: | ||
- `mem`: Basic in-memory store and the default. | ||
- `ocmem`: Advanced in-memory store allowing max size. | ||
- `redis`: Stores data in a configured redis cluster. | ||
- `etcd`: Stores data in a configured etcd cluster. | ||
- `nats-js`: Stores data using key-value-store feature of nats jetstream. https://docs.nats.io/nats-concepts/jetstream/key-value-store | ||
- `noop`: Stores nothing. Useful for testing. Not recommended in productive enviroments. | ||
|
||
1. Note that in-memory stores are by nature not reboot persistant. | ||
2. Events stay in the store for 2 weeks by default. 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.