The dweet Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The dweet Reference Manual

This is the dweet Reference Manual, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:35:33 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Dweet

This is a dweet.io client for Common Lisp.

Careful, boredom begets software of questionable value.

Example

Dweet machine information to lispmachines:

(dweet:with-thing "lispmachines"
  (dweet:post :instance (machine-instance)
              :type (machine-type)
              :version (machine-version)))

The first parameter to dweet:post can be the thing's name:

(dweet:post "luckynumbers" :n (random 100))

Fetch latest dweet:

(dweet:latest "lispmachines")

;; ==> ("thing" "lispmachines" "created" "2014-10-25T00:00:29.239Z" "content"
;;      ("instance" "sneeze.adeht.org" "type" "X86-64" "version"
;;       "Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz"))

Fetch "all" dweets (within dweet.io limitations):

(dweet:all "luckynumbers")

;; ==> #(("thing" "luckynumbers" "created" "2014-10-25T00:25:33.099Z" "content" ("n" 68))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:31.965Z" "content" ("n" 37))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:31.038Z" "content" ("n" 99))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:29.288Z" "content" ("n" 43))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:27.884Z" "content" ("n" 58))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:26.522Z" "content" ("n" 97))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:25.189Z" "content" ("n" 5))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:24.071Z" "content" ("n" 95))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:25:22.732Z" "content" ("n" 44))
;;       ("thing" "luckynumbers" "created" "2014-10-25T00:24:25.401Z" "content" ("n" 92)))

Listen to dweets as they come:

(dweet:listen (lambda (dweet)
                (format t "~A~%" dweet))
              "lispmachines")

To Do

Locking and alerts and stuff...

License

MIT


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 dweet

Author

death <github.com/death>

License

MIT

Description

A dweet.io client for Common Lisp

Dependencies
Source

dweet.asd (file)

Component

dweet.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 dweet.asd

Location

dweet.asd

Systems

dweet (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 dweet/dweet.lisp

Parent

dweet (system)

Location

dweet.lisp

Packages

dweet

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 dweet

A dweet.io client for Common Lisp

Source

dweet.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *base-uri*

Base URI for the dweet service.

Package

dweet

Source

dweet.lisp (file)

Special Variable: *thing*

Name of the thing dweeting.

Package

dweet

Source

dweet.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: with-thing NAME &body FORMS

Evaluate FORMS in the context of a dweet thing named by NAME.

Package

dweet

Source

dweet.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: all &optional *THING*

Fetch and return a vector of all dweets on server. Will return an empty vector if none found.

Package

dweet

Source

dweet.lisp (file)

Function: latest &optional *THING*

Fetch and return the latest dweet, or return NIL if none found.

Package

dweet

Source

dweet.lisp (file)

Function: listen HANDLER &optional *THING*

Listen for dweets coming from the server, calling the HANDLER function with them as they arrive.

Package

dweet

Source

dweet.lisp (file)

Function: post &rest PLIST

Post a dweet with supplied keys and values. The plist is interpreted as a Lisp representation for a JSON object. The first parameter may be a thing’s name, in which case the plist comes afterwards.

Package

dweet

Source

dweet.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Generic functions

Generic Function: http-error-body CONDITION
Package

dweet

Methods
Method: http-error-body (CONDITION http-error)
Source

dweet.lisp (file)

Generic Function: http-error-headers CONDITION
Package

dweet

Methods
Method: http-error-headers (CONDITION http-error)
Source

dweet.lisp (file)

Generic Function: http-error-reason CONDITION
Package

dweet

Methods
Method: http-error-reason (CONDITION http-error)
Source

dweet.lisp (file)

Generic Function: http-error-status CONDITION
Package

dweet

Methods
Method: http-error-status (CONDITION http-error)
Source

dweet.lisp (file)

Generic Function: http-error-uri CONDITION
Package

dweet

Methods
Method: http-error-uri (CONDITION http-error)
Source

dweet.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.5 Conditions

Condition: http-error ()

Represents a dweet HTTP error.

Package

dweet

Source

dweet.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: body
Initargs

:body

Readers

http-error-body (generic function)

Slot: status
Initargs

:status

Readers

http-error-status (generic function)

Slot: headers
Initargs

:headers

Readers

http-error-headers (generic function)

Slot: uri
Initargs

:uri

Readers

http-error-uri (generic function)

Slot: reason
Initargs

:reason

Readers

http-error-reason (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: ignoring-status (STATUS &optional RETURN-VALUE) &body FORMS

Evaluate FORMS while "ignoring" dweet HTTP errors with status equal to the evaluation of STATUS, i.e. returning the evaluation of RETURN-VALUE when such errors are encountered.

Package

dweet

Source

dweet.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: json-from-octets OCTETS

Parse the supplied OCTETS vector into a Lisp representation of a JSON object.

Package

dweet

Source

dweet.lisp (file)

Function: make-listener HANDLER

Return a stream receiver function that parses dweet chunks and calls the HANDLER function with them.

Package

dweet

Source

dweet.lisp (file)

Function: print-http-error ERROR STREAM

Print a human-friendly HTTP error message to the stream.

Package

dweet

Source

dweet.lisp (file)

Function: request METHOD PATH &key CONTENT STREAM-RECEIVER

Send a dweet request of some kind. METHOD should be either :GET or :POST. PATH is the relative path (sans leading slash) to call. If posting, CONTENT should be a Lisp representation of a JSON object. If listening, STREAM-RECEIVER should be a function to call with the HTTP stream.

Package

dweet

Source

dweet.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   D   F   L  
Index Entry  Section

D
dweet.asd: The dweet<dot>asd file
dweet/dweet.lisp: The dweet/dweet<dot>lisp file

F
File, Lisp, dweet.asd: The dweet<dot>asd file
File, Lisp, dweet/dweet.lisp: The dweet/dweet<dot>lisp file

L
Lisp File, dweet.asd: The dweet<dot>asd file
Lisp File, dweet/dweet.lisp: The dweet/dweet<dot>lisp file

Jump to:   D   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   F   G   H   I   J   L   M   P   R   W  
Index Entry  Section

A
all: Exported functions

F
Function, all: Exported functions
Function, json-from-octets: Internal functions
Function, latest: Exported functions
Function, listen: Exported functions
Function, make-listener: Internal functions
Function, post: Exported functions
Function, print-http-error: Internal functions
Function, request: Internal functions

G
Generic Function, http-error-body: Exported generic functions
Generic Function, http-error-headers: Exported generic functions
Generic Function, http-error-reason: Exported generic functions
Generic Function, http-error-status: Exported generic functions
Generic Function, http-error-uri: Exported generic functions

H
http-error-body: Exported generic functions
http-error-body: Exported generic functions
http-error-headers: Exported generic functions
http-error-headers: Exported generic functions
http-error-reason: Exported generic functions
http-error-reason: Exported generic functions
http-error-status: Exported generic functions
http-error-status: Exported generic functions
http-error-uri: Exported generic functions
http-error-uri: Exported generic functions

I
ignoring-status: Internal macros

J
json-from-octets: Internal functions

L
latest: Exported functions
listen: Exported functions

M
Macro, ignoring-status: Internal macros
Macro, with-thing: Exported macros
make-listener: Internal functions
Method, http-error-body: Exported generic functions
Method, http-error-headers: Exported generic functions
Method, http-error-reason: Exported generic functions
Method, http-error-status: Exported generic functions
Method, http-error-uri: Exported generic functions

P
post: Exported functions
print-http-error: Internal functions

R
request: Internal functions

W
with-thing: Exported macros

Jump to:   A   F   G   H   I   J   L   M   P   R   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
B   H   R   S   U  
Index Entry  Section

*
*base-uri*: Exported special variables
*thing*: Exported special variables

B
body: Exported conditions

H
headers: Exported conditions

R
reason: Exported conditions

S
Slot, body: Exported conditions
Slot, headers: Exported conditions
Slot, reason: Exported conditions
Slot, status: Exported conditions
Slot, uri: Exported conditions
Special Variable, *base-uri*: Exported special variables
Special Variable, *thing*: Exported special variables
status: Exported conditions

U
uri: Exported conditions

Jump to:   *  
B   H   R   S   U  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   D   H   P   S  
Index Entry  Section

C
Condition, http-error: Exported conditions

D
dweet: The dweet system
dweet: The dweet package

H
http-error: Exported conditions

P
Package, dweet: The dweet package

S
System, dweet: The dweet system

Jump to:   C   D   H   P   S