testutils

package
v3.0.10+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LaunchNatsServer

func LaunchNatsServer() (*ari.Client, context.CancelFunc, error)

LaunchNatsServer launches a nats server

Types

type Player

type Player struct {
	Next chan struct{}
	// contains filtered or unexported fields
}

Player is the test player that can be primed with sample data

func NewPlayer

func NewPlayer() *Player

NewPlayer creates a new player

func (*Player) Append

func (p *Player) Append(h *ari.PlaybackHandle, err error)

Append appends the given Play results

func (*Player) Play

func (p *Player) Play(mediaURI string) (h *ari.PlaybackHandle, err error)

Play pops the top results and returns them, as well as triggering player.Next

type PlayerPair

type PlayerPair struct {
	Handle *ari.PlaybackHandle
	Err    error
}

A PlayerPair is the pair of results returned from a mock Play request

type Recorder

type Recorder struct {
	Next chan struct{}
	// contains filtered or unexported fields
}

Recorder is the test player that can be primed with sample data

func NewRecorder

func NewRecorder() *Recorder

NewRecorder creates a new player

func (*Recorder) Append

func (r *Recorder) Append(h *ari.LiveRecordingHandle, err error)

Append appends the given Play results

func (*Recorder) Record

func (r *Recorder) Record(name string, opts *ari.RecordingOptions) (h *ari.LiveRecordingHandle, err error)

Record pops the top results and returns them, as well as triggering player.Next

type RecorderPair

type RecorderPair struct {
	Handle *ari.LiveRecordingHandle
	Err    error
}

A RecorderPair is the pair of results returned from a mock Record request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL