Minor cleanup

This commit is contained in:
James Mills 2018-03-29 10:44:02 -07:00
parent fcaf76b14d
commit f1ed5bd63c
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6
2 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ Pull the messages off the "hello" queue using `curl`:
```#!bash
$ curl -q -o - http://localhost:8000/hello
{"id":0,"topic":{"name":"hello","ttl":60000000000,"seq":1,"created":"2018-03-25T13:18:38.732437-07:00"},"payload":"eyJtZXNzYWdlIjogImhlbGxvIn0=","expires":"0001-01-01T00:00:00Z","created":"2018-03-25T13:18:38.732465-07:00"}
{"id":0,"topic":{"name":"hello","ttl":60000000000,"seq":1,"created":"2018-03-25T13:18:38.732437-07:00"},"payload":"eyJtZXNzYWdlIjogImhlbGxvIn0=","created":"2018-03-25T13:18:38.732465-07:00"}
```
Decode the payload:
@ -177,7 +177,7 @@ Example:
```#!bash
$ curl -q -o - http://localhost:8000/hello
{"id":0,"topic":{"name":"hello","ttl":60000000000,"seq":1,"created":"2018-03-25T13:18:38.732437-07:00"},"payload":"eyJtZXNzYWdlIjogImhlbGxvIn0=","expires":"0001-01-01T00:00:00Z","created":"2018-03-25T13:18:38.732465-07:00"}
{"id":0,"topic":{"name":"hello","ttl":60000000000,"seq":1,"created":"2018-03-25T13:18:38.732437-07:00"},"payload":"eyJtZXNzYWdlIjogImhlbGxvIn0=","created":"2018-03-25T13:18:38.732465-07:00"}
```
## DELETE /<topic>

View File

@ -13,6 +13,7 @@ import (
)
const (
// DefaultTTL is the default TTL (time to live) for newly created topics
DefaultTTL = 60 * time.Second
)
@ -29,7 +30,6 @@ type Message struct {
ID uint64 `json:"id"`
Topic *Topic `json:"topic"`
Payload []byte `json:"payload"`
Expires time.Time `json:"expires"`
Created time.Time `json:"created"`
}