Skip to content

Commit

Permalink
Update connection options
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcdaniel committed Dec 4, 2023
1 parent 6cb7db5 commit e652efa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
## Setup

```typescript
import * as taskvalve from "https://deno.land/x/taskvalve@1.0.4/mod.ts"
import * as taskvalve from "https://deno.land/x/taskvalve@1.0.5/mod.ts"
import { load } from "https://deno.land/std@0.204.0/dotenv/mod.ts"

const env = await load()

const crypto = new taskvalve.DefaultCrypto(env['APP_NAME'], env['APP_KEY'])
const model = new taskvalve.model.MySQL(crypto, env['DB_HOST'], env['DB_PORT'], env['DB_NAME'], env['DB_USER'], env['DB_PASS'])
const queue = new taskvalve.queue.Redis(crypto, model, env['REDIS_HOST'], env['REDIS_PORT'])
const queue = new taskvalve.queue.Redis(crypto, model, env['REDIS_HOST'], env['REDIS_PORT'], env['REDIS_USER'], env['REDIS_PASS'])

const workflow = new taskvalve.WorkflowStub(queue)
```
Expand Down Expand Up @@ -49,12 +49,12 @@ const queue = new taskvalve.queue.PostgreSQL(crypto, model, env['DB_HOST'], env[

```typescript
const model = new taskvalve.model.MySQL(crypto, env['DB_HOST'], env['DB_PORT'], env['DB_NAME'], env['DB_USER'], env['DB_PASS'])
const queue = new taskvalve.queue.Redis(crypto, model, env['REDIS_HOST'], env['REDIS_PORT'])
const queue = new taskvalve.queue.Redis(crypto, model, env['REDIS_HOST'], env['REDIS_PORT'], env['REDIS_USER'], env['REDIS_PASS'])
```

## PostgreSQL

```typescript
const model = new taskvalve.model.PostgreSQL(crypto, env['DB_HOST'], env['DB_PORT'], env['DB_NAME'], env['DB_USER'], env['DB_PASS'])
const queue = new taskvalve.queue.Redis(crypto, model, env['REDIS_HOST'], env['REDIS_PORT'])
const queue = new taskvalve.queue.Redis(crypto, model, env['REDIS_HOST'], env['REDIS_PORT'], env['REDIS_USER'], env['REDIS_PASS'])
```
6 changes: 5 additions & 1 deletion queue/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export class Redis implements IQueue {
private model: IModel,
private hostname: string = 'redis',
private port: number = 6379,
private username?: string,
private password?: string,
public connection: string = 'redis',
public queue: string = 'default'
) {}
Expand All @@ -30,7 +32,9 @@ export class Redis implements IQueue {

const redis = await connect({
hostname: this.hostname,
port: this.port
port: this.port,
username: this.username,
password: this.password
})

const { iv, data, mac } = await this.crypto.encrypt(command({
Expand Down

0 comments on commit e652efa

Please sign in to comment.