Updated documentation.

This commit is contained in:
mikestefanello 2024-06-22 09:57:02 -04:00
parent b1c0ccf0c5
commit 2d2c21df49

View file

@ -143,11 +143,7 @@ Originally, Postgres and Redis were chosen as defaults but since the aim of this
### Dependencies ### Dependencies
Ensure the following are installed on your system: Ensure that [Go](https://go.dev/) is installed on your system.
- [Go](https://go.dev/)
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/install/)
### Start the application ### Start the application
@ -933,6 +929,7 @@ err := c.Cache.
Set(). Set().
Key("my-key"). Key("my-key").
Data(myData). Data(myData).
Expiration(time.Hour * 2).
Save(ctx) Save(ctx)
``` ```
@ -943,6 +940,7 @@ err := c.Cache.
Set(). Set().
Group("my-group"). Group("my-group").
Key("my-key"). Key("my-key").
Expiration(time.Hour * 2).
Data(myData). Data(myData).
Save(ctx) Save(ctx)
``` ```
@ -954,16 +952,6 @@ err := c.Cache.
Set(). Set().
Key("my-key"). Key("my-key").
Tags("tag1", "tag2"). Tags("tag1", "tag2").
Data(myData).
Save(ctx)
```
**Include an expiration:**
```go
err := c.Cache.
Set().
Key("my-key").
Expiration(time.Hour * 2). Expiration(time.Hour * 2).
Data(myData). Data(myData).
Save(ctx) Save(ctx)
@ -1008,7 +996,7 @@ As shown in the previous examples, cache tags were provided because they can be
Tasks are queued operations to be executed in the background, either immediately, at a specfic time, or after a given amount of time has passed. Some examples of tasks could be long-running operations, bulk processing, cleanup, notifications, etc. Tasks are queued operations to be executed in the background, either immediately, at a specfic time, or after a given amount of time has passed. Some examples of tasks could be long-running operations, bulk processing, cleanup, notifications, etc.
Since we're already using [SQLite](https://sqlite.org/) for our database, it's available to act as a persistent store for queued tasks so that tasks are never lost, can be retried until successful, and their concurrent execution can be managed. [Goqite](https://github.com/maragudk/goqite) is the library chosen to interface with [SQLite] and handle queueing tasks and processing them asynchronously. Since we're already using [SQLite](https://sqlite.org/) for our database, it's available to act as a persistent store for queued tasks so that tasks are never lost, can be retried until successful, and their concurrent execution can be managed. [Goqite](https://github.com/maragudk/goqite) is the library chosen to interface with [SQLite](https://sqlite.org/) and handle queueing tasks and processing them asynchronously.
To make things even easier, a custom client (`TaskClient`) is provided as a _Service_ on the `Container` which exposes a simple interface with [goqite](https://github.com/maragudk/goqite) that supports type-safe tasks and queues. To make things even easier, a custom client (`TaskClient`) is provided as a _Service_ on the `Container` which exposes a simple interface with [goqite](https://github.com/maragudk/goqite) that supports type-safe tasks and queues.