Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorToMap(err error, parent string) map[string]interface{}
- func Listen(ctx context.Context, conn *nats.Conn, appName string, h Handler) error
- func MapToError(i map[string]interface{}) error
- func New(nc *nats.Conn, application string, d *session.Dialog, opts Options) (cl *ari.Client, err error)
- type Conn
- type ContinueRequest
- type CreateBridgeRequest
- type DialRequest
- type Handler
- type Options
- type PlayRequest
- type RecordRequest
- type SnoopRequest
- type UpdateMailboxRequest
Constants ¶
const DefaultRequestTimeout = 200 * time.Millisecond
DefaultRequestTimeout is the default timeout for a NATS request
Variables ¶
var Logger = log15.New()
Logger defaults to a discard handler (null output). If you wish to enable logging, you can set your own handler like so:
ari.Logger.SetHandler(log15.StderrHandler)
Functions ¶
func ErrorToMap ¶
ErrorToMap converts an error type to a key-value map
func MapToError ¶
MapToError converts a JSON parsed map to an error type
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is the wrapper type for a nats connnection along some ARI specific options
func (*Conn) RawRequest ¶
RawRequest sends a tiered request, with an initial OK to acknowledge receipt, followed by either a response or an error.
func (*Conn) ReadRequest ¶
ReadRequest sends a request that is a "read"... a request which can be retried as needed without consequence. NOTE: It is less about "read" operations and more about operations which are repeatable/idempotent.
type ContinueRequest ¶
type ContinueRequest struct { Context string `json:"context"` Extension string `json:"extension"` Priority int `json:"priority"` }
ContinueRequest is the request body for continuing over the message queue
type CreateBridgeRequest ¶
type CreateBridgeRequest struct { ID string `json:"bridgeId,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` }
CreateBridgeRequest is the request for creating bridges
type DialRequest ¶
DialRequest is the request for the channel dial operation
type Options ¶
type Options struct { // ReadOperationRetryCount is the amount of times to retry a read operation ReadOperationRetryCount int // RequestTimeout is the timeout duration of a request RequestTimeout time.Duration Parent context.Context }
Options is the list options
type PlayRequest ¶
type PlayRequest struct { PlaybackID string `json:"playback_id"` MediaURI string `json:"media_uri"` }
PlayRequest is the request for playback
type RecordRequest ¶
type RecordRequest struct { Name string `json:"name"` Format string `json:"format"` MaxDuration int `json:"maxDurationSeconds"` MaxSilence int `json:"maxSilenceSeconds"` IfExists string `json:"ifExists,omitempty"` Beep bool `json:"beep"` TerminateOn string `json:"terminateOn,omitempty"` }
RecordRequest is a request for recording
type SnoopRequest ¶
type SnoopRequest struct { SnoopID string App string Options *ari.SnoopOptions }
SnoopRequest is the NATs snoop request
type UpdateMailboxRequest ¶
UpdateMailboxRequest is the encoded request for updating the mailbox